XP is just a number | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Other than it won't compile? You need to make that $item.
And yes you could concievably run in to scoping issues. Someone else will correct me if I'm incorrect about this but I believe that if for example, you declare my $item at the top of your program, then it's got global scope. However if that foreach loop was placed in a subroutine then it's going to be local to that routine and you wouldn't have access to it outside the loop.
Update:Fletch picked up what I failed to take in to account completely about being visible within the foreach loop.
Useless trivia: In the 2004 Las Vegas phone book there are approximately 28 pages of ads for massage, but almost 200 for lawyers.
In reply to Re: Scoping of my with foreach loop
by Popcorn Dave
|
|