JPH wrote:
I found the script below at
http://hints.macworld.com/dlfiles/is_tcp_port_listening_pl.txt

I am trying to figure out what's happening at lines 20-23.
Why is the author using 'shift ||' and not a plain $host = $hostname;

Because the author is not a very good Perl programmer?

And why use:

if ($#ARGV != 1) {

Instead of the more correct:

if ( @ARGV != 2 ) {

Or use:

  close SOCKET || die "close: $!";

Instead of the more correct:

  close SOCKET or die "close: $!";

Or:

  close( SOCKET ) || die "close: $!";




John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction.                   -- Albert Einstein

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to