Re: [CDBI] Re: Trouble with Perl's reverse function
Carlos Vicente <cvicente-zZ82ZiX1S8l+u43qRgrggVnYRNhDb3e+9nwVQlTi/[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Message-ID | <[email protected]> |
> >> 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