Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://929512]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2023-12-05 22:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (29 votes). Check out past polls.

    Notices?