WG: Open files and looking a word

2007-08-31 Thread Angerstein
, lets say with file-tail, just use a RegEx. While...{ if ($line =~ m/unreachable/){print "down!\n"}; ...} -Ursprüngliche Nachricht- Von: Chas Owens [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 31. August 2007 15:21 An: Rodrigo Tavares Cc: beginners@perl.org Betreff: Re: Open

Re: Open files and looking a word

2007-08-31 Thread Chas Owens
On 8/31/07, Rodrigo Tavares <[EMAIL PROTECTED]> wrote: > Hello, > > I'm doing a script, it run a ping in many computers > and create a log file. > > I need search in log file the word "Destination Host > Unreachable". So, I have to take below line. After > using regular expressions taking ferrari.

Open files and looking a word

2007-08-31 Thread Rodrigo Tavares
Hello, I'm doing a script, it run a ping in many computers and create a log file. I need search in log file the word "Destination Host Unreachable". So, I have to take below line. After using regular expressions taking ferrari.lab and print "The host is down !". example: PING ferrari.lab (192.