Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 examining the Monastery: (9)
As of 2014-08-21 19:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (143 votes), past polls