[ Please post from an email client/service that preserves newlines. ]

org chen wrote:
I am coding a script to read a pure txt fiel and show it. I can't understand why any lines in the file match the word of "[DIED]".

Probably because of the typo I pointed out below.

        while(my $line = <>){
                chomp( $line );
                        print "<p>current line is $line";
                if($line =~ /^[Mon|Tue|Wed|Thu|Wed|Fri|Sat|Sun]/){

That line does not do what you think it does. Probably you mean:

    if ($line =~ /^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)/) {

                        #push old data into array
                        print "<p>time: $line";
                }                elsif($line = ~ /\[DIED\]/){
------------------------------------------------^

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to