Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Returning _which_ pattern matched...?

by scain (Curate)
on Aug 03, 2001 at 19:02 UTC ( #102002=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if ($string =~ /re1/ || $string =~ /re2/ || $string =~ /re3/)
    
  2. or download this
    if      ( $string =~ /re1/ ) {
    #do thing 1
    ...
    } elsif ( $string =~ /re3/ ) {
    #do thing 3
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2023-03-28 17:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (68 votes). Check out past polls.

    Notices?