Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: ${^MATCH} regex special variable(s) and /p regex modifier

by lidden (Curate)
on Oct 04, 2011 at 14:16 UTC ( #929556=note: print w/ replies, xml ) Need Help??


in reply to Re^3: ${^MATCH} regex special variable(s) and /p regex modifier
in thread ${^MATCH} regex special variable(s) and /p regex modifier

Yes, but it seems anything but a literal string will make the variable defined.
$ perl -wE 'my $s = "foo 123"; $s =~ /\d+/; say ${^PREMATCH}' foo

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2016-07-25 19:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (226 votes). Check out past polls.