in reply to preserving hash value outside the loop
Yes, it is possible. Simply declare $key outside the while loop instead of inside it. See Coping with Scoping.
Of course you'll only see the value from the last time $key is set but it's not immediately clear from your post if that's a problem for you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: preserving hash value outside the loop
by Anonymous Monk on May 11, 2016 at 10:31 UTC | |
by hippo (Archbishop) on May 11, 2016 at 10:59 UTC |