in reply to Re^2: Processing data from SSH stream
in thread Processing data from SSH stream

Btw, it's a good habit to use local to restrict the scope of modifications to special variables such as $\.

An example from the perlvar doco:

my $content = ''; open my $fh, "foo" or die $!; { local $/; $content = <$fh>; } close $fh;