Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 romping around the Monastery: (3)
As of 2016-05-29 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?