Re: Reading a value from a hash using a variable for the key

2011-01-24 Thread Eyal B.
On Jan 21, 11:42 pm, ewinst...@gmail.com ("Eyal B.") wrote: > On Jan 21, 4:30 pm, rob.di...@gmx.com (Rob Dixon) wrote: > > > > > On 21/01/2011 05:50, Erez Schatz wrote: > > > > On 20 January 2011 15:38, Eyal B.  wrote: > > > >> I'm getting an error on the line where I should use the TTL variable -

Re: Reading a value from a hash using a variable for the key

2011-01-24 Thread אייל ב .
Guys You claim : s/.*TTL=//; will erase the line, leaving with an empty (uninitialized) $line variable. I want to ask : If so, how print "TTL = $line\n" does give me the right value ! If it will leave $line containing a null (zero-length or undef) string - how can I print it ? (I get TTL = 125 if

Re: Reading a value from a hash using a variable for the key

2011-01-24 Thread Eyal B.
If so, how print "TTL = $line\n" does give me the right value ! (I get TTL = 125 if ping to Windows machine. Thanks, for your answers. On Jan 21, 4:30 pm, rob.di...@gmx.com (Rob Dixon) wrote: > On 21/01/2011 05:50, Erez Schatz wrote: > > > > > On 20 January 2011 15:38, Eyal B.  wrote: > > >> I'm

Re: Reading a value from a hash using a variable for the key

2011-01-24 Thread Shlomi Fish
Hi Eyal, On Friday 21 Jan 2011 15:55:58 אייל ב. wrote: > Hi Shlomi, Again. > I'm sorry for keep sending you mails (It's because my answers to the > to the group still doesn't work and I sent a complaint to > postmas...@perl.org) > > I hope now when I use a plain text message, it will be more unde

Re: Reading a value from a hash using a variable for the key

2011-01-23 Thread Eyal B.
On Jan 21, 4:30 pm, rob.di...@gmx.com (Rob Dixon) wrote: > On 21/01/2011 05:50, Erez Schatz wrote: > > > > > On 20 January 2011 15:38, Eyal B.  wrote: > > >> I'm getting an error on the line where I should use the TTL variable - > >> and take the right value from the hash (%list) :Use of uninitiali

Re: Reading a value from a hash using a variable for the key

2011-01-21 Thread Rob Dixon
On 21/01/2011 05:50, Erez Schatz wrote: On 20 January 2011 15:38, Eyal B. wrote: I'm getting an error on the line where I should use the TTL variable - and take the right value from the hash (%list) :Use of uninitialized value in print at D:\system\perl\os-rec\os-rec5_.pl line 24 , line 3. A

Re: Reading a value from a hash using a variable for the key

2011-01-21 Thread Eyal B.
On Jan 21, 7:50 am, moonb...@gmail.com (Erez Schatz) wrote: > On 20 January 2011 15:38, Eyal B. wrote: > > > > > I'm writing a scripts that check the TTL of the ping and found the OS. > > According the TTL - the script should let me know which OS it is : > > Linux/ Windows or Unix (Hash table) > >

Re: Reading a value from a hash using a variable for the key

2011-01-21 Thread Eyal B.
Tried to implement your recommendations step by step . #! C:\Perl\bin\perl use strict; use warnings; my %list = (60=>"linux",61=>"linux",62=>"linux",63=>"linux", 64=>"linux",65=>"linux",125=>"Windows",126=>"Windows",127=>"Windows", 128=>"Windows",250=>"Unix",251=>"Unix",252=>"Unix",253=>

Re: Reading a value from a hash using a variable for the key

2011-01-21 Thread Shlomi Fish
Hi Eyal, I should note that your plain text message is mal-formatted. It's not clear which parts were said by me, and which parts were said by you. Next time, please configure your mailer (GMail.com?) to format the message as plaintext and to use proper "> " quoting as needed by netiquette rule

Re: Reading a value from a hash using a variable for the key

2011-01-20 Thread Erez Schatz
On 20 January 2011 15:38, Eyal B. wrote: > I'm writing a scripts that check the TTL of the ping and found the OS. > According the TTL - the script should let me know which OS it is : > Linux/ Windows or Unix (Hash table) > > I'm getting an error on the line where I should use the TTL variable - >

Re: Reading a value from a hash using a variable for the key

2011-01-20 Thread Shlomi Fish
Hi Eyal, On Thursday 20 Jan 2011 15:38:00 Eyal B. wrote: > I'm writing a scripts that check the TTL of the ping and found the OS. > According the TTL - the script should let me know which OS it is : > Linux/ Windows or Unix (Hash table) > > I'm getting an error on the line where I should use the

Reading a value from a hash using a variable for the key

2011-01-20 Thread Eyal B.
I'm writing a scripts that check the TTL of the ping and found the OS. According the TTL - the script should let me know which OS it is : Linux/ Windows or Unix (Hash table) I'm getting an error on the line where I should use the TTL variable - and take the right value from the hash (%list) :Use o