Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: regex with arrays and variables

by jwkrahn (Monsignor)
on Apr 25, 2013 at 18:19 UTC ( #1030713=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      if ($i =~ m/@array2/) {
    
         print "$i is in array2 - skipping\n";
    
  2. or download this
    my $regex = "(";
    foreach (@array2) {
      $regex .= $_ . "|";
    }
    $regex .= ")";
    
  3. or download this
    my $regex = "(";
    $regex .= join "|", @array2;
    $regex .= ")";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1030713]
help
Chatterbox?
[Discipulus]: LA something a little more perlish? @mts = map {qx!mp3info -p $_!} glob '/path/*.mp3 (hazarded code)

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2017-04-23 20:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (432 votes). Check out past polls.