sub read { my $socket = shift; my $timeout = shift || 60; return undef unless( _is_valid( $socket ) ); my $hash; local $@ = ''; eval{ local $SIG{ ALRM } = sub{ die "ALRM:Read Time Out\n" }; alarm( $timeout ); $hash = fd_retrieve( $socket ); alarm( 0 ); }; if( $@ ) { return undef; } return $hash; }