|
|
| We don't bite newbies here... much | |
| PerlMonks |
Comment on |
| ( #3333=superdoc: print w/ replies, xml ) | Need Help?? |
|
First off you've declared the sub as having no arguments. Secondly within the curly braces of the sub you have changed context and $i is uninitialized within that context and therefor you are going to print zeros for each iteration. Here is code that does what you think it should:
Now... you could have saved yourself a lot of pain if you had at the beginning of your code. Bailiff, lock him up. Peter L. Berghold -- Unix Professional Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg In reply to Re: foreach-loop-local var in sub
by blue_cowdawg
|
|