Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 exploiting the Monastery: (7)
As of 2014-10-25 15:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (145 votes), past polls