socks - Perl Socket Connection Check -
i've been trying debug perl issue awhile had made no head way. i'm trying determain if connection socks4/5 connection.
# ./pctest.pl name "main::junk" used once: possible typo @ ./pctest.pl line 60. name "main::empty" used once: possible typo @ ./pctest.pl line 60. io::socket::inet: bad hostname 'c1(x' ...propagated @ ./pctest.pl line 52.
i've had error (before added or die @$; @ end):
can't use undefined value symbol reference @ ./pctest.pl line 56.
.
... $look = io::socket::inet->new( peeraddr => $_, proto => 'tcp', timeout => 5 ) or die @$; $sock4 = pack( "ccs", 4, 1, 80 ); print $look $sock4; read( $look, $recv, 10 ); ( $empty, $granted, $junk ) = unpack( "c c c6", $recv ); if( $granted == 0x5a ) { print " yes\n"; } else { print " no\n"; } ...
there's typo. @$
should $@
.
to rid of "possible typo" messages , since $empty
, $junk
seem unused in code, write:
my @result = unpack("c c c6", $recv); if ($result[1] == 0x5a) { # ... }
Comments
Post a Comment