Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: How to Properly Clear Variables for reuse in a loopby linuxer (Curate) |
on Apr 23, 2009 at 22:12 UTC ( [id://759684]=note: print w/replies, xml ) | Need Help?? |
Your variables are declared with my within the while loop. So they are re-initialized on each run and shouldn't know of their previous value. And you assign a value to $url on each run; so it should even work without the my inside the loop, as the content of $url is overwritten on each run of the loop. Ergo: If you see the same output per run, the problem is in FetchURL as others already mentioned.
You can see, each print prints the value of $i and $j doesn't "remember" its previous content. update: sentence rewritten
In Section
Seekers of Perl Wisdom
|
|