[CDBI] Re: Trouble with Perl's reverse function

Edward J. Sabol sabol at alderaan.gsfc.nasa.gov
Tue Nov 14 23:04:48 GMT 2006


Perrin suggested:
> Or maybe something squirrely in this:
>
>> if ( my $zone = ($class->search( mname => $domain ))[0] ){
>
> if ( my $zone = $class->search(mname => $domain)->first ) {

Looks like Ricardo already solved Carlos' problem, but I just thought that
I'd chime in in favor of changing "(...)[0]" to "->first" anyway. I haven't
benchmarked it personally, but I believe this to be an easy and very
worthwhile optimization to make.



More information about the ClassDBI mailing list