develooper Front page | perl.beginners | Postings from February 2009

strange string match

Thread Next
From:
org chen
Date:
February 15, 2009 17:32
Subject:
strange string match
Message ID:
COL110-W260A59D90E1D07A06FA032CDB70@phx.gbl

Hi,
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]".
 
Thanks
Org
------------------------------------------------the txt file is like this:
 
Fri Feb 13 14:31:26 2009[PROCESS]: Welcome to our system![ERROR]: Please check step 1![SUCCESS]: all done! enjoy the data!
---------------------------------------My code is: ...
        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";                }        }
-------------------------------------------the result is:
 
Current line is Fri Feb 13 14:31:26 2009time: Fri Feb 13 14:31:26 2009current line is [PROCESS]: Welcome to our system!DIED: 18446744073709551615 current line is [ERROR]: Please check step 1!DIED: 18446744073709551615 current line is [SUCCESS]: all done! enjoy the data!DIED: 18446744073709551615 
-----------------------------------------------------
_________________________________________________________________
Get the most out of your life online! Click here for the latest news and tips.
http://livelife.ninemsn.com.au/
Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About