in reply to Re: Too much SQL not enough perl
in thread Too much SQL not enough perl
my @items = split/,/,$_; foreach my $item (@items){
foreach my $item (split/,/,$_){
These are slow (grep) (checks every element even if the first matches), inefficient (same reason), and potentially buggyBut, granted it still says:
Hearing the word "in" is an indication that you probably should have used a hash, not a list or array, to store your data. Hashes are designed to answer this question quickly and efficiently. Arrays aren’t.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Too much SQL not enough perl
by Roy Johnson (Monsignor) on Oct 10, 2005 at 13:33 UTC | |
by Aristotle (Chancellor) on Oct 10, 2005 at 14:48 UTC | |
by Roy Johnson (Monsignor) on Oct 10, 2005 at 14:58 UTC | |
by Aristotle (Chancellor) on Oct 10, 2005 at 15:24 UTC | |
|
Re^3: Too much SQL not enough perl
by InfiniteSilence (Curate) on Oct 10, 2005 at 15:10 UTC |