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

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

by JavaFan (Canon)
on Oct 04, 2011 at 11:15 UTC ( #929512=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -wE 'my $s = "foo bar"; $s =~ /(bar)/; say ${^PREMATCH}'
    foo 
    ...
    Use of uninitialized value $^PREMATCH in say at -e line 1.
    
    $
    
  2. or download this
    $ perl -Mre=debug -wE 'my $s = "foo bar"; $s =~ /bar/;'
    Compiling REx "bar"
    ...
    Match successful!
    Freeing REx: "(bar)"
    $
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-07-28 23:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (210 votes), past polls