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

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

by BillKSmith (Deacon)
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 studying the Monastery: (9)
As of 2015-07-29 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls