in reply to
foreach localizing variables
While I agree with the above comments that you should pass the value as a parameter to the subroutine. You can get the behaviour you seem to want by making $value a 'our' variable:
our $value = "four";
[download]
Comment on
Re: foreach localizing variables
Download
Code
In Section
Seekers of Perl Wisdom