in reply to slow CGI's
I don't know to what extent Perl is optimised, but I suppose accessing a member of an array is somewhat slower than accessing a private variable. And especially if the indexing takes place inside a loop. So how about this:
if ( defined($array[0]) ) { my $array0 = $array[0]; foreach ( @numbers ) { next unless $array0 == $_; print "FOUND<p>"; } }
--bwana147
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: slow CGI's
by chromatic (Archbishop) on Jul 07, 2003 at 18:14 UTC | |
by saintbrie (Scribe) on Jul 08, 2003 at 04:25 UTC |