You can't get at the loop's inner value of $_ outside the loop, because the while command automatically localizes it. Just do it the way you do here with $result, by assigning it to a variable that does exist outside the loop.
Aaron B.
Available for small or large Perl jobs and *nix system administration; see my home node.
In reply to Re: Using Variable outside of loop with Net::SSH
by aaron_baugher
in thread Using Variable outside of loop with Net::SSH
by Nich240
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |