Well, I think I've fixed most of the newbie mistakes thanks to forum help. I also found out that the x'15' is the character under EBCDIC, so had to change my regex. Here's the new code snip......
open (VDOSLOG, ">$VIRUS_DLOG") or die "Error cannot open dos virus log: $!"; while( <VLOG> ) { # s/\x0A/\x0D\x0A/g; # output file is mashed. s/\x15/\x0D\x0A/g; # output file correct on mainframe, empty on Windows print VDOSLOG; # prints $_ to filehandle VDOSLOG } close VLOG; close VDOSLOG; $to = $EMAIL; $subject = "Virus Warning: NIMDA found on $HOSTNAME"; send_mail($to,$subject,$VIRUS_DLOG); With the old regex using x'0A' the body of the email is mashed on the windows platform. With the new regex using x'15' the output file is correct on the mainframe (the bytecount has been increased by the number of lines in the file, browsing on the mainframe shows everything on one line) but the body of the email is blank on the windows mail platform. Any other ideas would be appreciated. Thanks, Beth Rice >>2- I get "Illegal Hexadecimal Digit '\' ignored" against the line that has > > >You should use \x0a instead of \xa. > >>if ( $EMAIL ne "" ) { >> print "inside EMAIL code test \n"; >> if ( $INFECTED == 1 ) { >> print "inside INFECTED code test \n"; >> open (VLOG, "<$VIRUS_LOG") or die "Error cannot read virus log: $! >>\n"; >> open (VDOSLOG, "$>VIRUS_DLOG") or die "Error cannot open dos log: $! >>\n"; >> while( <VLOG> ) { >> print; >> s/\xa/\xd\xa/g; >> print; >> print <VDOSLOG>; > >Here's your mistake. Calling <VDOSLOG> is trying to READ from the >filehandle. If you have warnings on, you'll hear about that. You want to >write to it: > > print VDOSLOG; > >will print $_ to VDOSLOG. > >> } >> >> close VLOG; >> close VDOSLOG; >> >>$ perl -w ck_nimda.pl -d2 -e [EMAIL PROTECTED] -f /u/homedirs/id03l/scripts -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]