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 gett

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 Januar

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 t

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 : > >

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=>

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