RE: SPLIT - What is it?

2002-06-14 Thread Timothy Johnson
First off, check out 'perldoc -f split'. That will get you the man page. This works for all built-in functions. But here goes: split() is used to split up a string using a delimiter that you specify. The basic syntax is this: split(/patternToMatch/,$stringToSplit,$numberOfElements); The

Re: SPLIT - What is it?

2002-06-14 Thread Teresa Raymond
>Can someone explain to me what the purpose of split is? I am assuming you >can take like a text file or something and separate it out? > >Thanks >Mike > > > >-- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] -- --- -

SPLIT - What is it?

2002-06-14 Thread Michael Pratt
Can someone explain to me what the purpose of split is? I am assuming you can take like a text file or something and separate it out? Thanks Mike -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: "lazy" variable declaration

2002-06-14 Thread Chas Owens
> This is one of the reasons I gave up on "-w" a long time ago. You had > to program around the $^%&@ "use of undefined value" warning constantly. > > Of course, Perl 5.6 introduced the "no warnings qw(uninitialized);" > construct, which helps that problem, at the expense of some typing... I o

Re: "lazy" variable declaration

2002-06-14 Thread Chas Owens
On Fri, 2002-06-14 at 15:50, todd r wade wrote: > > > Chas Owens wrote: > > > > > >> Alternately, you could say: > >> > >> $track ||= ''; > >> > >> right before the next time you use foo after the split. I dont know > why this > >> works offhand, I just remember reading in the docs somewher

RE: RegEx to match Valid IP Address

2002-06-14 Thread Mat Harris
yes i suppose you are right, consider my tail between my legs. At 15:03 14/06/2002 -0400, Jason Frisvold wrote: >Perhaps your network engineer was thinking in relation to a Class C? In >reality, you can have subnets where .3 is a broadcast... (/30) It's >all relative to what subnet mask you ar

RE: "lazy" variable declaration

2002-06-14 Thread Bob Showalter
> -Original Message- > From: todd r wade [mailto:[EMAIL PROTECTED]] > Sent: Friday, June 14, 2002 3:51 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: "lazy" variable declaration > > ... > Your examples are neither equivalent nor dangerous in the context of > this threa

RE: Serious pattern matching.

2002-06-14 Thread Craig Hammer
John, Thanks for the optimized version. The outfile isn't used yet. I have it sitting there because that is the next step. Craig Hammer Internal Infrastructure Team Lead Parago, Inc. 972-538-3936 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTE

Re: How to open STDOUT ?

2002-06-14 Thread Chas Owens
On Fri, 2002-06-14 at 07:15, Franck FASANO wrote: > > > > Objet: Re: How to open STDOUT ? > > Date: Thu, 13 Jun 2002 21:34:16 -0700 > > De: "Todd Wade" <[EMAIL PROTECTED]> > > A: [EMAIL PROTECTED] > > > > "Franck Fasano" <[EMAIL PROTECTED]> wrote in message > > [EMAIL PROTECTED]">news:[EMAIL PROTE

Re: How to open STDOUT ?

2002-06-14 Thread Chas Owens
On Fri, 2002-06-14 at 08:14, Angela Fisher wrote: > Hi, > > I replaced qx{ ./test.pl -P @ARGV}; > with exec(" ./test.pl -P @ARGV"); > > This works. I'm very new at this so excuse the > question. Can "qx{}" be used to execute a command > or script? It just looks like a way to quote a string >

Re: "lazy" variable declaration

2002-06-14 Thread todd r wade
Chas Owens wrote: > >> Alternately, you could say: >> >> $track ||= ''; >> >> right before the next time you use foo after the split. I dont know why this >> works offhand, I just remember reading in the docs somewhere that its exempt >> from warnings. But for me, that is crossing over int

file tokenizers

2002-06-14 Thread Torres, Jose
Hi, I have a script that opens a file and needs to grab certain values from it. Can anyone recommend a good file tokenizing module? Thanks. -Jose -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: String Length?

2002-06-14 Thread Nikola Janceski
check out length(); perldoc -f length > -Original Message- > From: Batchelor, Scott [mailto:[EMAIL PROTECTED]] > Sent: Friday, June 14, 2002 3:26 PM > To: '[EMAIL PROTECTED]' > Subject: String Length? > > > Is there an easy way to compare the length of a string to a value? > > Such as

String Length?

2002-06-14 Thread Batchelor, Scott
Is there an easy way to compare the length of a string to a value? Such as: If $var < 8 { Do something } Thanks in advance. Scott -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: RegEx to match Valid IP Address

2002-06-14 Thread Jason Frisvold
Perhaps your network engineer was thinking in relation to a Class C? In reality, you can have subnets where .3 is a broadcast... (/30) It's all relative to what subnet mask you are using for that particular IP address. --- Jason H. Frisvold Senior ATM Engineer Engineeri

Re: Serious pattern matching.

2002-06-14 Thread John W. Krahn
Craig Hammer wrote: > > Take a look at this script. I created it to read my firewall log files, and > then give me a sort and count per unique address. You could substitute a > more traditional grep in place of the substitution I use. > > > opendir(DIR, "/clog1") || die("Unable to open logdir

Re: RegEx to match Valid IP Address

2002-06-14 Thread Mat Harris
ok, maybe that is ok but I recently was told by a networking engineer that the last octet _shouldn't_ be 255. the first 3 can be i think. At 14:34 14/06/2002 -0400, Tim Musson wrote: >Hey Mat, > >My MUA believes you used NeoMail 1.25 >to write the following on Friday, June 14, 2002 at 9:04:54 AM

Re: RegEx to match Valid IP Address

2002-06-14 Thread drieux
On Friday, June 14, 2002, at 11:34 , Tim Musson wrote: > Hey Mat, > > My MUA believes you used NeoMail 1.25 > to write the following on Friday, June 14, 2002 at 9:04:54 AM. > > MH> actually, it should only be 1-254 inclusive as 255 is reserved for > MH> broadcast or other special addresses (some

print $body update . . . .

2002-06-14 Thread tom poe
Hi: Well, here's a success: #! /usr/local/bin/perl -w # Simple program to prepare an email message for entry into a database # This program simply discards header information, and prints message # body. It assumes a specific number of lines for $header, which in my case # is 5. The range operato

Re: RegEx to match Valid IP Address

2002-06-14 Thread Tim Musson
Hey Mat, My MUA believes you used NeoMail 1.25 to write the following on Friday, June 14, 2002 at 9:04:54 AM. MH> actually, it should only be 1-254 inclusive as 255 is reserved for MH> broadcast or other special addresses (sometimes not used atall). MH> oficially the 255 node it ignored. I don'

Re: "lazy" variable declaration

2002-06-14 Thread Chas Owens
> Alternately, you could say: > > $track ||= ''; > > right before the next time you use foo after the split. I dont know why this > works offhand, I just remember reading in the docs somewhere that its exempt > from warnings. But for me, that is crossing over into the land of ugly =0). $track

Re: How to open STDOUT ?

2002-06-14 Thread Chas Owens
On Fri, 2002-06-14 at 08:20, Mat Harrison wrote: > why are you typing > > print STDOUT "text here\n"; > > try just typing > > print "text here\n"; > > because STDOUT is the default destination for text when you run it from > the command line. This is sort of true. STDOUT is the f

Perl and Jscript Question

2002-06-14 Thread Mike
Im working on an example from a book and incorperating perl script to a scroll type program this is what I have for perl: #!/usr/bin/perl print "Content-type: application/x-javascript\n\n"; print "var result = new Array("; use LWP::Simple; $URL = get 'http://www.perl.org'; print $URL; print

RE: parsing a variable ----- THANK YOU LIST :) IT Works :)

2002-06-14 Thread Tucker, Ernie
Thank You Thank You Thank You I LOVE THIS MAILING LIST!!! Ernest P. Tucker II Network Technician "The organization that can't communicate can't change, and the corporation that can't change is dead." --Nido Qubein -Original Message- From: Bob Showalter [mailto:[EMAIL

RE: parsing a variable

2002-06-14 Thread Bob Showalter
> -Original Message- > From: Tucker, Ernie [mailto:[EMAIL PROTECTED]] > Sent: Friday, June 14, 2002 10:39 AM > To: [EMAIL PROTECTED] > Subject: parsing a variable > > > I have a global variable name @offline. It has the following > information > stored in the variable. What I need to do

RE: parsing a variable

2002-06-14 Thread Tucker, Ernie
oops forgot the code. Here it is. foreach $offline (@offline) { $mac = $offline =~ m/.* (\.\.) .*/; push (@macs,$mac); } -Original Message- From: Tucker, Ernie [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 12:07 PM To: 'Janek Schleicher'; [EMAIL PROTECTED] S

RE: parsing a variable

2002-06-14 Thread Tucker, Ernie
Would something like this work? I tried it but it returned all 1. Any ideas Ernest P. Tucker II Network Technician "The organization that can't communicate can't change, and the corporation that can't change is dead." --Nido Qubein -Original Message- From: Janek Schleicher [mail

RE: parsing a variable

2002-06-14 Thread Janek Schleicher
Robert Hanson wrote at Fri, 14 Jun 2002 17:49:03 +0200: > How about this? > > # untested > my @mac = map {/((?:[a-fA-F0-9]{4}\.){2}[a-fA-F0-9]{4})/ and $1} ( @offline ); > > Rob > or perhaps a little bit more readable: my $hexdigit = qr/[a-fA-F0-9]/; my $hexword = qr/$hexdigit{4}/; my $mac

Re: Calling Perl script from php.

2002-06-14 Thread drieux
On Friday, June 14, 2002, at 07:38 , Batchelor, Scott wrote: > In Perl: > > $var = @ARGV; > > print "$var"; > > By just printing the $var to STDOUT in perl should give me the $returnvar. print the @ARGV would have shown you all that was passed. Think about the symantical problem here - you ju

RE: parsing a variable

2002-06-14 Thread Hanson, Robert
How about this? # untested my @mac = map {/((?:[a-fA-F0-9]{4}\.){2}[a-fA-F0-9]{4})/ and $1} ( @offline ); Rob -Original Message- From: Tucker, Ernie [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 11:37 AM To: Hanson, Robert; Tucker, Ernie; [EMAIL PROTECTED] Subject: RE: parsing

RE: parsing a variable

2002-06-14 Thread Tucker, Ernie
thanks is there any other ways to do this. What I would like to do is something like the following. I would like to grep out the second column which is the mac id and store it into a variable called @mac. Any help would be great. I am have brain drain. Ernest P. Tucker II Network Technician

Re: RegEx to match Valid IP Address

2002-06-14 Thread drieux
On Friday, June 14, 2002, at 06:04 , Mat Harrison wrote: [..] > actually, it should only be 1-254 inclusive as 255 is reserved for > broadcast or other special addresses (sometimes not used atall). > oficially the 255 node it ignored. that is actually a "dangerous" assertion to make. Since it ba

Re: Syntax of mkdir()

2002-06-14 Thread Jeff 'japhy' Pinyan
On Jun 13, John W. Krahn said: >> if ($invnummer ne "") { > >What if $invnumber has the value undef? If $invnummer [sic] is undef, then in a string context, $invnummer DOES eq "", so he's safe. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #

RE: parsing a variable

2002-06-14 Thread Hanson, Robert
Here is one solution... For each item in @offline the MAC will be captured in the variable $1. # untested... for ( @offline ) { if ( /((?:[a-fA-F0-9]{4}\.){2}[a-fA-F0-9]{4})/ ) { print "MAC: $1\n"; } else { print "No MAC here\n"; } } Rob -Original Message- From: Tucker

Re: How to open STDOUT ?

2002-06-14 Thread Angela Fisher
Thanks for your reponse. exec() can be replaced with system() to get the return value too! Angela Franck FASANO wrote: > > Thank you for the answer Angela! > That's a solution. > > but exec is different of qx (it doesn't return anything except false > if the command is not found ) and I nee

parsing a variable

2002-06-14 Thread Tucker, Ernie
I have a global variable name @offline. It has the following information stored in the variable. What I need to do is parse or split the variable and store the mac id in a variable . What is the proper way to do this? Cable3/0/U0 0020.4098.43fc 944 onlineJun 13 14:09:56 0.00 32.56 5 Cab

RE: Calling Perl script from php.

2002-06-14 Thread Batchelor, Scott
Ok, I am still having some problems with this... Here is basically what I am doing... In PHP: Exec ("path/perlscript.pl", $var1, $returnvar) Now this calls the perl script from PHP passing the perl script $var1 The perl script then should run and give me $returnvar. In Perl: $var = @ARGV;

RE: Controlling Novell products with Perl

2002-06-14 Thread David Gray
> Does anyone have experience of using Perl to control any > Novell products such as Netware, eDirectory (NDS) etc. > > I don't have a specific requirement at present but we do a > lot of Novell stuff and I am interested to know what can > be/has been done. > > Apologies if this question is a

Re: How to open STDOUT ?

2002-06-14 Thread Franck FASANO
Thank you for the answer Angela! That's a solution. but exec is different of qx (it doesn't return anything except false if the command is not found ) and I need the return value because my script is more huge than test.pl in fact. Several scripts call others . An other is to replace qx by prin

RE: Output has HEX values??

2002-06-14 Thread David Gray
> I'm using the following command to output the results to screen and a > output file: > > open(F,"tee $2 @ARGV[0].txt >CON:"); > > This works great but the output file created .txt > has a "box" > ascii character. Looks like a carraige return also. > How can I remove this? This sounds like

Re: RegEx to match Valid IP Address

2002-06-14 Thread Mat Harrison
actually, it should only be 1-254 inclusive as 255 is reserved for broadcast or other special addresses (sometimes not used atall). oficially the 255 node it ignored. > , > > I seem to recall a discussion on a RegEx to match an IP address, but > can't seem to find it. Anyone have any idea

Re: How to open STDOUT ?

2002-06-14 Thread Mat Harrison
why are you typing print STDOUT "text here\n"; try just typing print "text here\n"; because STDOUT is the default destination for text when you run it from the command line. > > > > > Objet: Re: How to open STDOUT ? > > Date: Thu, 13 Jun 2002 21:34:16 -0700 > > De: "Todd Wade" <[

RE: RegEx to match Valid IP Address

2002-06-14 Thread Hanson, Robert
You could either roll your own or use Regexp::Common. http://www.cpan.org/modules/by-module/Regexp/Regexp-Common-0.01.readme It might look like this... (?:[1]?\d{1,2}|2[0-4]\d|25[0-5]\.){3}[1]?\d{1,2}|2[0-4]\d|25[0-5] Or something like that. Rob -Original Message- From: Tim Muss

RE: Serious pattern matching.

2002-06-14 Thread Craig Hammer
Langa, Take a look at this script. I created it to read my firewall log files, and then give me a sort and count per unique address. You could substitute a more traditional grep in place of the substitution I use. <> Craig Hammer Internal Infrastructure Team Lead Parago, Inc. 972-538-3936

RegEx to match Valid IP Address

2002-06-14 Thread Tim Musson
, I seem to recall a discussion on a RegEx to match an IP address, but can't seem to find it. Anyone have any ideas, or recall what it would be? Or could toss it together? First Octet is 1-255 inclusive, Second Octet is 0-255 inclusive, Third Octet is 0-255 inclusive, Fourth Octe

Re: How to open STDOUT ?

2002-06-14 Thread Angela Fisher
Hi, I replaced qx{ ./test.pl -P @ARGV}; with exec(" ./test.pl -P @ARGV"); This works. I'm very new at this so excuse the question. Can "qx{}" be used to execute a command or script? It just looks like a way to quote a string to me. Angela Franck FASANO wrote: > > > > > Objet: Re: How to o

Re: How to open STDOUT ?

2002-06-14 Thread Franck FASANO
> > Objet: Re: How to open STDOUT ? > Date: Thu, 13 Jun 2002 21:34:16 -0700 > De: "Todd Wade" <[EMAIL PROTECTED]> > A: [EMAIL PROTECTED] > > "Franck Fasano" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Hi, > > > > I have recuperated a module from the web

Re[2]: Controlling Novell products with Perl

2002-06-14 Thread Daniel Gardner
This sounds fairly interesting... http://developer.novell.com/ndk/perl5.htm There's some docs at the bottom of that page about doing stuff with Novell things using perl. Can't say I've ever used it myself, and haven't touched a netware box for years, but it looks like good stuff. hth, Daniel

Re: email body question still

2002-06-14 Thread Michael Lamertz
On Thu, Jun 13, 2002 at 11:27:05PM -0700, tom poe wrote: > #! /usr/local/bin/perl -w > open (IN, "<$file") or die "Can't open $file: !$\n"; > while () { > # Skip lines unless we have a blank line > next unless /^\s*?/; Nope. The comment doesn't match your code. The code says "cont

Re: perl with unix commands

2002-06-14 Thread Ramprasad A Padmanabhan
Did U chk the directory u r in try doing this `cd $DIRECTORY; cp src dest `; Ronnie Livingston wrote: > Hi, I have a textfile with a list of gifs (ex. planet.gif, star.gif)and I > have a perl program which grabs one of the filenames randomly. What I > want to do is use the filename and copy it

RE: Searching for a specific spot on a page

2002-06-14 Thread Ramprasad A Padmanabhan
Thats simple. change the regexp $filestr=~s/$SEARCH.*?$SEARCH/$SEARCH $HTML $SEARCH /; On Fri, 2002-06-14 at 09:36, Troy May wrote: > Thank you, that worked! :) > > By the way, I'm thinking of a new thing that I want to do. How would I > alter this to open another page the same way, but re

Re: perl with unix commands

2002-06-14 Thread Ronnie Livingston
doh, that did it. thanks felix. -Ronnie On 14 Jun 2002, Felix Geerinckx wrote: > on Fri, 14 Jun 2002 06:43:53 GMT, [EMAIL PROTECTED] (Ronnie > Livingston) wrote: > > > Hi, I have a textfile with a list of gifs (ex. planet.gif, > > star.gif)and I have a perl program which grabs one of the > > fi

Re: display a section of text

2002-06-14 Thread Janek Schleicher
Michael Pratt wrote at Fri, 14 Jun 2002 00:14:41 +0200: > Well that doesnt give me what I want. I want to search a text file for a Key word >then display > the contents to a second keyword. > > For example take the above paragraph and display just ' want to search a text file >for a Key word

Re: Serious pattern matching.

2002-06-14 Thread Felix Geerinckx
on Fri, 14 Jun 2002 05:42:04 GMT, [EMAIL PROTECTED] (Langa Kentane) wrote: > Greetz, > I need some help with IP address matching. For instance I have a > log with an IP address 10.3.2.1 and 10.3.4.5. I want to match all > IP addresses in the 10.3.0.0 mask 255.255.0.0 range. How would I > do this

Re: perl with unix commands

2002-06-14 Thread Felix Geerinckx
on Fri, 14 Jun 2002 06:43:53 GMT, [EMAIL PROTECTED] (Ronnie Livingston) wrote: > Hi, I have a textfile with a list of gifs (ex. planet.gif, > star.gif)and I have a perl program which grabs one of the > filenames randomly. What I want to do is use the filename and > copy it to random.gif but I k