Make it a global variable, don't use "my"
Ummm... Just a thought, aside from what diotalevi said, I don't think Perl would be happy with that solution since the original poster has Use Strict; in his code.
It's poor coding practice to unnecessarily declare such broad scopes when smaller scopes would be just as effective. I can't tell you how often I reuse variable names, making it even more important to limit their scope. Can you imagine the kind of bugs that would crop up if you use a global variable called $count in all your While loops?
----
Is it fair to stick a link to my site here?
Thanks for you patience.
In reply to Re: Re: Use variable outside if statement
by SavannahLion
in thread Use variable outside if statement
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |