As you are running on Windows you may need to use binmode() on your log
file to make
the read ignore the EOF character.
Regards: Colin
Conor Lillis wrote:
Message
Hi, I havge a script qwhich analyses our
Mailsweeper logs for traffic statistic purposes. Unfortunately some
spam mailers have started putting EOF chars (hex 1A) into the subject
line, causing my script to only partially load the log file when
reading the file in. Is there a way to overcome this ?
Here is the read statement that is failing, I
can provide a snippet of the logfile as an attachment to anyone who is
interested..
my $logfile= 'v:\\logfile\\20040715.log';
if (-e $logfile){open (LOG,"$logfile") || die
$!;}
@array = (<LOG>);
close(LOG);
print "There are "[EMAIL PROTECTED]." lines in the
file $logfile\n";
print "Last line ".(@array-1)." is [EMAIL PROTECTED]";
exit;
The information in this e-mail is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
e-mail by anyone else is unauthorised. If you are not the intended
recipient, any disclosure, copying, distribution or any other action
taken or any views, opinions or advice contained in this e-mail are
those of the sending individual and not necessarily those of the firm.
It is possible for data transmitted by e-mail to be deliberately or
accidentally corrupted or intercepted. For this reason where the
communication is by e-mail, J&E Davy does not accept any
responsibility for any breach of confidence which may arise from the
use of this medium. If you have received this e-mail in error please
notify us immediately at mailto:[EMAIL PROTECTED] and delete this e-mail
from your system.
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
|
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs