in reply to Net::Telnet disappearing data :)
...the second snippet of code fixes it...but i don't know how to break the loop looking for eof or timeout...
You can use the timed_out method to test for timeout.
my $lineid = 0; while ($lineid < 20) { my $linedata = $connect->getline; # check for eof or time-out _before_ using the data last if $connect->eof or $connect->timed_out; # now save the line push(@data,$linedata); $lineid++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Net::Telnet disappearing data :)
by DesolateCoder (Initiate) on Jul 24, 2001 at 01:34 UTC |