Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 having an uproarious good time at the Monastery: (8)
As of 2016-06-29 16:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (385 votes). Check out past polls.