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

Carlos Vicente cvicente at network-services.uoregon.edu
Tue Nov 14 23:15:40 GMT 2006


> >> 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.

That's right.  It should be faster, especially in tables with many
rows.  

Thanks for the note.

cv



More information about the ClassDBI mailing list