Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

regex with arrays and variables

by xorl (Deacon)
on Apr 25, 2013 at 17:52 UTC ( #1030711=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    
    }
    
  2. or download this
    my $regex = "(";
    foreach (@array2) {
      $regex .= $_ . "|";
    }
    $regex .= ")";
    
  3. or download this
    if ($i =~ m/$regex/) {
    
  4. or download this
    #!/usr/bin/perl
    
    ...
    # Do something with $i now.
    
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2016-08-24 18:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (348 votes). Check out past polls.