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

Re: What this pattern matches

by ikegami (Patriarch)
on May 12, 2006 at 05:22 UTC ( [id://548909]=note: print w/replies, xml ) Need Help??


in reply to What this pattern matches

That code stores in $1 a copy of $b with everything after the last "_" removed, including the "_" itself.

There are exceptions.
$1 is left unchanged if $b contains no "_".
$1 is left unchanged if $b contains nothing before the last "_".
$1 is left unchanged if $b contains nothing after the last "_".

When executed in list context, it returns $1 on match or an empty list on failure to match.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2025-06-25 07:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.