RE: Help getting scripts working...

2003-02-14 Thread Dan Muey
> > 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

Re: Help getting scripts working...

2003-02-14 Thread Rob Dixon
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

Re: Help getting scripts working...

2003-02-14 Thread Rob Dixon
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

Re: Help getting scripts working...

2003-02-13 Thread R. Joseph Newton
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

Re: Help getting scripts working...

2003-02-12 Thread wiggins
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 (

Re: Help getting scripts working...

2003-02-12 Thread wiggins
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..

Re: Help getting scripts working...

2003-02-12 Thread Lance
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

RE: Help getting scripts working...

2003-02-12 Thread Bill Akins
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

Re: Help getting scripts working...

2003-02-12 Thread Janek Schleicher
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

Re: Help getting scripts working...

2003-02-11 Thread John W. Krahn
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 =

Re: Help getting scripts working...

2003-02-11 Thread Wiggins d'Anconia
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