On Oct 16, Lance Murray said:
>#!/bin/perl
You should get used to using 'strict' and warnings
#!/bin/perl -w
use strict;
>$host = @ARGV[0];
That should be $ARGV[0].
>$port = @ARGV[1];
Why not:
my ($host, $port) = @ARGV;
>@reply = `echo " " | telnet $host $port`;
>if $reply[1] =~ /Connected/ {
You're missing the ()'s around the conditional:
if ($reply[1] =~ /Connected/) { ... }
> print "Port is up\n";
>else
> print "Port is down\n";
>}
Why not tell us the error message, by the way?
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
[ I'm looking for programming work. If you like my work, let me know. ]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]