Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Too much SQL not enough perl

by osunderdog (Deacon)
on Oct 10, 2005 at 12:13 UTC ( #498781=note: print w/replies, xml ) Need Help??


in reply to Too much SQL not enough perl

I prefer to use Set::Scalar for this type of condition.

use strict; use Set::Scalar; my @testItems = qw|a b c d e f g|; my $set = Set::Scalar->new('a', 'b', 'c'); foreach my $item (@testItems) { if($set->has($item)) { print "$item is in set\n"; } } __END__ Results: a is in set b is in set c is in set

Although I haven't looked at the performance of this package compared to methods suggested in this thread.

Hazah! I'm Employed!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://498781]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2020-12-05 09:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (63 votes). Check out past polls.

    Notices?