Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by BillKSmith (Chaplain)
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


Comment on Re^2: Do values from string exist within array?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2014-09-18 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (109 votes), past polls