in reply to socket help
The implicit use of global $_ in the client code seems a bit odd. This variable is not set explicitly from the command line without careful invocation:
echo myarg | perl -nle 'print "ARG=<$_>\n"' ARG=<myarg>
You're better off, at least, fetching from ARGV:
...or however you want to parse the command line arguments in @ARGV.my ($hostname) = @ARGV; die "usage: $0 hostname" unless $hostname; my $socket = new IO::Socket::INET ( PeerAddr => $hostname, PeerPort => '7071', Proto => 'tcp', );
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: socket help
by Anonymous Monk on Feb 14, 2011 at 02:47 UTC |
In Section
Seekers of Perl Wisdom