On Sun, Feb 15, 2009 at 20:32, org chen <[email protected]> wrote:
snip
> while(my $line = <>){ chomp( $line );
> print "<p>current line is $line";
> if($line =~ /^[Mon|Tue|Wed|Thu|Wed|Fri|Sat|Sun]/){
> #push old data into array print "<p>time:
> $line"; } elsif($line = ~ /\[DIED\]/){
> print "<p>DIED: $line "; }
> elsif($line =~ /\[SUCCESS\]/){ print "<p>
> success:$line"; } elsif($line =~
> /\[PROCESS\]/){ print "<p>process: $line";
> } }
snip
Wow, I hope your mail client did that to your code. The problem
appears to be the line the contains
elsif($line = ~ /\[DIED\]/)
This is assigning the complement of the result of running the regex
against $_ to $line. I doubt that is what you desired. I assume your
meant
elsif($line =~ /\[DIED\]/)
--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/