Here is some example code for your situation;
my $timeout = 5; eval { local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required alarm $timeout; @data = $tnet->cmd('show ip cache flow'); alarm 0; }; if ($@) { die unless $@ eq "alarm\n"; # propagate unexpected errors # timed out } else { # didn't }
In reply to Re: How to break while reading data from a Cisco router?
by bruceb3
in thread How to break while reading data from a Cisco router?
by Newb to Perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |