>
> R. Joseph Newton wrote:
> > Mark VanMiddlesworth wrote:
> >> What's wrong with the syntax, especially line 12?
>
> >> if ($arg = "-n") {$e = 0} # Line 12
Sorry if I'm misunderstanding what your're tryin gto do but to me it seems :
$arg = $ARGV[0]; # or whatever/however
R. Joseph Newton wrote:
> Mark VanMiddlesworth wrote:
>> What's wrong with the syntax, especially line 12?
>> if ($arg = "-n") {$e = 0} # Line 12
>
> You are asking, in the line above, whether your assignment of "-n" to
> the scalar $arg succeeded. Answer: true, always.
Not qu
R. Joseph Newton wrote:
> Mark VanMiddlesworth wrote:
>
>> this is a script that systematically pings every host on the network,
>> and writes the output to the screen. If the -n arg is specified, it
>> will also write to a disk. What's wrong with the syntax, especially
>> line 12?
>
> Why am I sup
Mark VanMiddlesworth wrote:
> this is a script that systematically pings every host on the network,
> and writes the output to the screen. If the -n arg is specified, it
> will also write to a disk. What's wrong with the syntax, especially
> line 12?
Why am I supposed to count to line 12, instead
On Tue, 11 Feb 2003 21:37:30 -0600, Mark VanMiddlesworth <[EMAIL PROTECTED]> wrote:
> OK, I cleaned up the script a bit. Here it is now, but I can't get it
> to accept two variables in a row:
>
> $b = 0;
> print "insert first three digits of ip (
Always group reply so others can help and be helped by your questions and the answers.
On Tue, 11 Feb 2003 21:11:38 -0600, Mark VanMiddlesworth <[EMAIL PROTECTED]> wrote:
> Wow, thanks for the help. I didn't use strict or use warnings
> because..
This will save you a world of hurt:
use strict;
and test your scripts with
perl -cw scriptname.pl
This tests your scripts for syntax errors - great for debugging!! If you
are calling modules from a directory outside of the normal perl @INC:
perl -cwI /weirdDirectory scriptname.pl
It took me
Sorry for top posting but makes this easier... Comments are in your
code below. Mostly you forgot semicolons in your code and used = when
you needed eq. BTW, I have not tested any of this, just spotted some
things.
HTH!!
Bill
-Original Message-
From: Mark VanMiddlesworth [mailto:[EMAIL
On Tue, 11 Feb 2003 20:11:46 -0500, Wiggins D'Anconia wrote:
In addition to Wiggins ...
> foreach my $x (1 .. 255) {
>
>> $a = `ping -q -c 1 192.168.1.$b`;
^^
Could it be that $x instead of $b was meant ?!
>> $b
Mark Vanmiddlesworth wrote:
>
> this is a script that systematically pings every host on the network,
> and writes the output to the screen. If the -n arg is specified, it
> will also write to a disk. What's wrong with the syntax, especially
> line 12?
>
> #!/usr/bin/env perl
>
> $x = 1;
> $b =
You may want to have a look at Net::Ping, but that isn't what you asked
Mark VanMiddlesworth wrote:
this is a script that systematically pings every host on the network,
and writes the output to the screen. If the -n arg is specified, it will
also write to a disk. What's wrong with the synt
11 matches
Mail list logo