Re: Extracting a Range of Lines

2006-06-04 Thread joseph
""Mr. Shawn H. Corey"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Mon, 2006-05-06 at 10:20 +0800, joseph wrote: >> @line = () if /^DATE:/; ## set array @line to an empty list if line begin >> DATE? > > Yes, this will clear out the previous record. > >> push @line, $_; ## th

Re: Extracting a Range of Lines

2006-06-04 Thread Mr. Shawn H. Corey
On Mon, 2006-05-06 at 10:20 +0800, joseph wrote: > @line = () if /^DATE:/; ## set array @line to an empty list if line begin > DATE? Yes, this will clear out the previous record. > push @line, $_; ## then push the value of line to an empty @line array? @line is empty only if this is the first

Re: Extracting a Range of Lines

2006-06-04 Thread joseph
""Mr. Shawn H. Corey"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Mon, 2006-05-06 at 08:51 +0800, joseph wrote: >> Hello List, >> >> I need help in extracting a range of lines from a log files, i tried to >> do >> it with this script: >> >> >> #!/bin/perl >> >> use strict

Re: Extracting a Range of Lines

2006-06-04 Thread Mr. Shawn H. Corey
On Mon, 2006-05-06 at 08:51 +0800, joseph wrote: > Hello List, > > I need help in extracting a range of lines from a log files, i tried to do > it with this script: > > > #!/bin/perl > > use strict; > use warnings; > > open(FILE,"/home/teragram/status_log.txt") or die "can't open file $!\n"