Re: RFC on first perl script

2003-11-07 Thread drowl
> <[EMAIL PROTECTED]> wrote: >> >> well im trying at lerning this perl stuff.. reading from the >> "learning >> perl" oreilly book and a few other places, >> but also using perl a long time before i should ie making the below >> script, so that i dont get in to any very bad habbits at such an ear

Re: RFC on first perl script

2003-11-07 Thread Rob Dixon
<[EMAIL PROTECTED]> wrote: > > well im trying at lerning this perl stuff.. reading from the "learning > perl" oreilly book and a few other places, > but also using perl a long time before i should ie making the below script, > so that i dont get in to any very bad habbits at such an early stage. >

Re: RFC on first perl script

2003-11-07 Thread Rob Dixon
<[EMAIL PROTECTED]> wrote: > > well im trying at lerning this perl stuff.. reading from the "learning > perl" oreilly book and a few other places, > but also using perl a long time before i should ie making the below script, > so that i dont get in to any very bad habbits at such an early stage. >

Re: RFC on first perl script

2003-11-06 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > Hi all > well im trying at lerning this perl stuff.. reading from the "learning > perl" oreilly book and a few other places, > but also using perl a long time before i should ie making the below script, > so that i dont get in to any very bad habbits at such an early st

RE: RFC on first perl script

2003-11-06 Thread Dan Muey
Howdy, Always use strict; Then your variables won't get messy, see the perldoc strict for more details. > foreach $site (@dataFile) { # loop for each line/site in dataFile > chomp $site; You might make your life easier to by not declaring a variable at all here: for(@datafile) {

RE: RFC on first perl script

2003-11-06 Thread Dan Anderson
> Global symbol "$site" requires explicit package name at ./makeArf.pl line 17. One of the things about strict is it makes you declare the scope of your variables before using them. So, for instance, while: #! /usr/bin/perl $foo = "foo\n"; print $foo; Would run, the following wouldn't: #! /usr

Re: RFC on first perl script

2003-11-06 Thread drowl
> On Thu, 06 Nov 2003 16:33:41 +, drowl wrote: >> #!/usr/bin/perl -w > > No big deal, but - IMO - easier to read, and it adds strict; > > #!/usr/bin/perl > # > use strict; > use warnings; > >> @dataFile=<>; # read in file from command line >> @standardRules=`cat standard.for.arf.txt` ;

Re: RFC on first perl script

2003-11-06 Thread drieux
On Thursday, Nov 6, 2003, at 09:56 US/Pacific, [EMAIL PROTECTED] wrote: i now get the below warning along with many others... how does one declair a varible then? Global symbol "$site" requires explicit package name at ./makeArf.pl line 17. I think your hit is at: foreach $site (@dataFile) {

RE: RFC on first perl script

2003-11-06 Thread drowl
t;); > setSpeedOut("$siteACRate"); > setDeviceSpeedIn("$siteACRate"); > setDeviceSpeedOut("$siteACRate"); > } > EOF > > It makes it a lot easier to read, not to mention I could remove the \n > and the \" escapes. BTW - If you h

Re: RFC on first perl script

2003-11-06 Thread Tore Aursand
On Thu, 06 Nov 2003 16:33:41 +, drowl wrote: > #!/usr/bin/perl -w No big deal, but - IMO - easier to read, and it adds strict; #!/usr/bin/perl # use strict; use warnings; > @dataFile=<>; # read in file from command line > @standardRules=`cat standard.for.arf.txt` ; my @dataFile

RE: RFC on first perl script

2003-11-06 Thread Hanson, Rob
nt standard bits This is pretty icky: >print ARFfile ("name matches \".*RH-Serial.*\": > {\n \tsetName(\"$SiteName-RH-WAN\$2\") ;\n \tsetGroup > (\"$siteGroup\") "); # print RH-Serial rule Try a here-document instead: # print RH-Serial rule

RFC on first perl script

2003-11-06 Thread drowl
Hi all well im trying at lerning this perl stuff.. reading from the "learning perl" oreilly book and a few other places, but also using perl a long time before i should ie making the below script, so that i dont get in to any very bad habbits at such an early stage. could some one please have a