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

Re: Compiling Regular Expressions

by hv (Prior)
on Feb 19, 2003 at 13:38 UTC ( [id://236621]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      for (@words) {
        print if /foo/;
      }
    
  2. or download this
      my $s = "foo";
      for (@words) {
        print if /$s/;
      }
    
  3. or download this
      my($s1, $s2) = qw/ foo bar /;
      for (@words) {
        print if /$s1/;
        print if /$s2/;
      }
    
  4. or download this
      my @s = qw/ foo bar /;
      for (@words) {
    ...
          print if /$s/;
        }
      }
    
  5. or download this
      my @s = map qr{$_}, qw/ foo bar /;
      for (@words) {
    ...
          print if /$s/;
        }
      }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://236621]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-12-13 03:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (67 votes). Check out past polls.