I tried that, it does not work for me! Lixin
-----Original Message----- From: Stovall, Adrian M. [mailto:[EMAIL PROTECTED]] Sent: Friday, November 22, 2002 5:28 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: regular expression question Cai Lixin said: > > > all, > > I want to check the first line of the file if it is machine > or not, like > > The first line of the file is: > > Job "\nest and \toolbox VOBs" began execution on 9/6/02 at 2:00:11 AM. > > my code is like: > > if (!-z $file) > { > open(LOG_FILE, "<$file") or warn " can not open $file:$!\n"; > my @read_lines = <LOG_FILE>; > close (LOG_FILE); > next unless chomp($read_lines[0]) =~ m#\"\nest and > \toolbox VOBs\"#; > } > > it did not work for regular expression, can you help me to > figure what is wrong with it? > You forgot to escape the backslashes...change your code to read: next unless chomp($read_lines[0]) =~ m#\"\\nest and \\toolbox VOBs\"#) perl -e "sub Sub{return reverse(@_);}$_='.$yyye k ca i Xl $yyye jX $yyye hto ZfX tq $uQ';s+[ \$]++g;s-j-P-;s^yyy^r^g;s:i:H:;s!X! !g;s|Z|n|;s*Q*J*;s{q}{s}g;s(f)(A);$print=join('',Sub(split('')));system( 'echo',$print);" To the optimist, the glass is half full. To the pessimist, the glass is half empty. To the engineer, the glass is twice as big as it needs to be. Adrian "Okay, I won't top-post unless it's an emergency" Stovall _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs