Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: 'Dynamic scoping' of capture variables ($1, $2, etc.)

by moritz (Cardinal)
on Dec 16, 2012 at 20:42 UTC ( [id://1009092]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use 5.010;
    use strict;
    ...
    __END__
    42
    undef
    
  2. or download this
    sub R {
       printf qq{before: \$_ is '$_'};
    ...
    after: $_ is 'xxxxx' $1 is '1' 
    after: $_ is 'xxxxx' $1 is '1' 
    after: $_ is 'xxxxx' $1 is '1'
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-18 04:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found