Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

(tye)Re2: Unusual Closure Behaviour

by tye (Cardinal)
on Jul 13, 2001 at 03:20 UTC ( #96228=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    Global symbol "$x" requires explicit package name
  2. or download this
    sub foo {
        my $x= $_[0]   if  ! defined $x;
        print "(@_):", ++$x, " ";
    ...
    print $/, $x= 10, $/;
    foo($_) for( 0,0,5,4,3,0,5,0,4,0,3 );
    print $/;
    
  3. or download this
    (0):1 (0):1 (5):6 (4):5 (3):4 (0):1 (5):6 (0):1 (4):5 (0):1 (3):4
    10
    (0):1 (0):2 (5):3 (4):1 (3):1 (0):1 (5):2 (0):1 (4):2 (0):1 (3):2
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://96228]
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: (10)
As of 2014-12-18 03:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (41 votes), past polls