Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Alarm and Telnet issues

by themage (Friar)
on Dec 27, 2006 at 16:59 UTC ( #591886=note: print w/replies, xml ) Need Help??

in reply to Alarm and Telnet issues

Hi pubscout,

Your code probably is not working because Net::Telnet uses internly alarm and $SIG{ALRM} to handler timeouts itself.

You should use the Net::Telnet timeout instead.

Replies are listed 'Best First'.
Re^2: Alarm and Telnet issues
by pubscout (Initiate) on Dec 27, 2006 at 20:04 UTC
    Bummer. I guess that means that there is no trivial way to have a global timeout when using Net::Telnet.

    Thanks for the help!

      Well, no lightweight trivial way.
      use POSIX (); $SIG{USR1} = sub { ... }; unless(fork) { sleep(4); kill(POSIX::SIGUSR1(), getppid()); exit; }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://591886]
[huck]: you cant sort a hash, hashs have their own unchangeable order
[huck]: but you can print a hash in sorted order
[huck]: my @aa; for my $key (sort keys %hash){push @aa,$key,$hash{$ke y};} print join(',',@aa)."\n ";

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2018-05-27 08:03 GMT
Find Nodes?
    Voting Booth?