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

Re: foreach-loop-local var in sub

by LanX (Canon)
on Jan 21, 2013 at 17:51 UTC ( #1014504=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
        };
        $print->();          # 0,1
    }
    
  2. or download this
    use strict;
    use warnings;
    ...
        $i = $_;
        my_print();          # 0,1
    }
    
  3. or download this
    use strict;
    use warnings;
    ...
    foreach (0, 1) {
        my_print($_);          # 0,1
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (16)
As of 2014-09-16 14:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (24 votes), past polls