Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: foreach-loop-local var in sub

by LanX (Bishop)
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2017-11-20 17:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (290 votes). Check out past polls.

    Notices?