Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Do values from string exist within array?

by BillKSmith (Priest)
on Oct 01, 2013 at 15:07 UTC ( #1056492=note: print w/replies, xml ) Need Help??


in reply to Re: Do values from string exist within array?
in thread Do values from string exist within array?

use strict; use warnings; use List::MoreUtils qw(any); my @GrpIDs = qw(123 456); my $query = '123,567'; my $QUERY = join '|', split(/,/, $query); if (any {/$QUERY/} @GrpIDs){ print "We have a match\n"; }
Bill

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1056492]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2016-12-04 19:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (69 votes). Check out past polls.