Re: problems matching strings within variables.

2006-03-02 Thread Chas Owens
On 3/2/06, Angus <[EMAIL PROTECTED]> wrote: snip > In my code below I tried to split the variable > $dhcp{$hostname}->{ip} into 4 separate octets but that failed, I then tried > to match the last 1 to 3 characters in $dhcp{$hostname}->{ip} but that also > failed. Can anyone tell me how I might do

Re: problems matching strings within variables.

2006-03-02 Thread John W. Krahn
Angus wrote: > Hello all, Hello, > I have found a very useful little module for parsing DHCP logs and in the > following script I have been able to create a hash of hashes based on the > data extracted from a dhcp log. However, my problem now is that I want to > determine what subnet a host is o

problems matching strings within variables.

2006-03-02 Thread Angus
Hello all, I have found a very useful little module for parsing DHCP logs and in the following script I have been able to create a hash of hashes based on the data extracted from a dhcp log. However, my problem now is that I want to determine what subnet a host is on. For the moment I will on

RE: Matching strings

2001-08-09 Thread Sofia
.. > > By doing the above, you match against whole name > if n-4.t-1 is passed or > only the node if t-1 is passed. I could be missing > something. > > Wags ;) > -Original Message- > From: Lynn Glessner [mailto:[EMAIL PROTECTED]] > Sent: Thursday, August

RE: Matching strings

2001-08-09 Thread Wagner-David
o:[EMAIL PROTECTED]] Sent: Thursday, August 09, 2001 10:18 To: Sofia; [EMAIL PROTECTED] Subject: Re: Matching strings I think that you just need to match the other way around to get the partial match. Instead of looking for the fileline within the name_passed, look for the name_passed within the fi

Re: Matching strings

2001-08-09 Thread Lynn Glessner
, another newbie). while() { chomp; if (/$name_passed/) { . - Original Message - From: "Sofia" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 09, 2001 9:59 AM Subject: Matching strings > I am having problems matching strings. I

Re: Matching strings

2001-08-09 Thread Brent Michalski
Don't diddle with $_ so much... You make things more confusing Here is what I see (forgive any formatting errors, using Lotus NOTes)... while() { $line = $_; # You are setting $line to the current value from chomp($line); # Getting rid of \n's etc.. (EOL chars) # Now here, why a

Matching strings

2001-08-09 Thread Sofia
I am having problems matching strings. I have the following code that reads a file with computer names and if a named passed to the script is in the file print yes otherwise print no, for example. The computer names are in the format n-4.t-1 meaning node four on rack 1. while() { $line

Re: Matching strings

2001-07-02 Thread Paul
--- Martin van-Eerde <[EMAIL PROTECTED]> wrote: > could you walk me through @h{@vars} = () > I think it means many keys of the hash will be assigned an > undefined list. > I dont understand the @ meaning array in @h !! > > my %h; > > @h{@vars} = (); > > if (keys %h != @vars) { $youlose = "yes" }

Re: Matching strings

2001-07-02 Thread Martin van-Eerde
could you walk me through @h{@vars} = () I think it means many keys of the hash will be assigned an undefined list. I dont understand the @ meaning array in @h !! Thanks > my %h; > @h{@vars} = (); > if (keys %h != @vars) { $youlose = "yes" } > > > -- > Peter Scott > Pacific Systems Design

Re: Matching strings

2001-06-29 Thread Martin van-Eerde
could you walk me through @h{@vars} = () I think it means many keys of the hash will be assigned an undefined list. I dont understand the @ meaning array in @h !! Thanks > my %h; > @h{@vars} = (); > if (keys %h != @vars) { $youlose = "yes" } > > > -- > Peter Scott > Pacific Systems Design

Re: Matching strings

2001-06-29 Thread twelveoaks
> Observe, ye doubter: > > $ perl -le '@vars = qw(one two three two); @h{@vars} - (); print > "Duplicate in (@vars)" unless keys %h == @vars; @vars = qw(one two three > four); > @hh{@vars} = (); print "Duplicate" unless keys %hh == @vars' > Duplicate in (one two three two) > $ > > Because.. wh

Re: Matching strings

2001-06-28 Thread Hasanuddin Tamir
On Thu, 28 Jun 2001, twelveoaks <[EMAIL PROTECTED]> wrote, > Peter Scott Wrote: > > > my %h; > > @h{@vars} = (); > > if (keys %h != @vars) { $youlose = "yes"; } > > > Maybe I'm missing something - won't these *always* match, since @vars has > been used to create keys %h? No, depends on the conte

Re: Matching strings

2001-06-28 Thread Peter Scott
At 09:37 PM 6/28/01 -0400, twelveoaks wrote: >Peter Scott Wrote: > > > my %h; > > @h{@vars} = (); > > if (keys %h != @vars) { $youlose = "yes"; } > >Maybe I'm missing something - won't these *always* match, since @vars has >been used to create keys %h? > >It seems that way when I test it. > >What

Re: Matching strings

2001-06-28 Thread twelveoaks
Peter Scott Wrote: > my %h; > @h{@vars} = (); > if (keys %h != @vars) { $youlose = "yes"; } Maybe I'm missing something - won't these *always* match, since @vars has been used to create keys %h? It seems that way when I test it. What I want to detect is whether any two of the values within

Re: Matching strings

2001-06-28 Thread Peter Scott
At 08:52 PM 6/28/01 -0400, twelveoaks wrote: >I have a series of variables, say, > $var0 $var1 $var2 $var3... >up to lots and lots depending on user input. > >They are also available as an array > @vars = (element1, element2,...) > >I want to test to see if any two of their values

RE: Matching strings

2001-06-28 Thread Wagner-David
ve to respond with a different value. Wags ;) -Original Message- From: twelveoaks [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 28, 2001 17:53 To: [EMAIL PROTECTED] Subject: Matching strings I have a series of variables, say, $var0 $var1 $var2 $var3... up to lots and

Matching strings

2001-06-28 Thread twelveoaks
I have a series of variables, say, $var0 $var1 $var2 $var3... up to lots and lots depending on user input. They are also available as an array @vars = (element1, element2,...) I want to test to see if any two of their values are identical. Basically if the user has made an