if you have other code inside the loop which you've removed for the sake of this sample, make sure it's not changing the value of $_ before you assign it to $result
Excellent point. So why not play it safe and dispense with $_ altogether?
my $result; while ($result = <$chan>) { ... } # use $result
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re^4: Using Variable outside of loop with Net::SSH2
by Athanasius
in thread Using Variable outside of loop with Net::SSH
by Nich240
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |