in reply to redirect stdout into hash
Since the Net::SSH::Channel object is also a tied filehandle, you can avoid all the C-style read buffering:
$channel->exec($command); my @array = <$channel>; # read output lines into an array # or my %hash = map { $_ => undef } <$channel>; # read output lines into a +hash's keys
Aaron B.
Available for small or large Perl jobs; see my home node.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: redirect stdout into hash
by doctorspears (Novice) on Jun 13, 2012 at 19:22 UTC | |
by aaron_baugher (Curate) on Jun 13, 2012 at 19:46 UTC | |
by doctorspears (Novice) on Jun 13, 2012 at 19:53 UTC | |
by aaron_baugher (Curate) on Jun 13, 2012 at 20:47 UTC |