Hi,

I have an issue that makes me think there maybe something fundamental I'm
misunderstanding about how perl operates.

The code below simply replaces the ASCII SOH character \001 with a space in
real time on a logfile.

And it works great if the output is printed to screen, BUT,  if it's
printed out to file it grabs the beginning part of the input file, then
stops, it fails to read in any more real time input.

Any ideas?

thanks in advance for any insights,

Adrian,

P.S.  I disguised original file names and directories.


#!/usr/bin/perl -w

open(STDERR, "/dev/null");

my $file = /somefile;
chomp $file;

open(LOG, "/$file")|| die "xxxx: $!";
open(OUTPUT, ">>another_file.fixlog");

for (;;){
 while ($line=<LOG>)
        {
                chomp ($line);
                $line=~tr/\001/ /;
#               print "$line\n";
                print OUTPUT "$line\n";
        }
sleep 1;
seek(LOG, 0,1);
}
----------------------------------------------------------------------------------------------------------------------------------------------------------------

                              <<Disclaimer>>
This message contains confidential information and is intended only for the
named individual.  If you are not the named addressee, you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this message in error and delete
this e-message from your system.

E-mail transmission cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, delayed in
transmission, incomplete, or may contain viruses. The sender therefore does
not accept liability for any errors or omissions in the contents of
this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version. This message
is provided for informational purposes and should not be construed as a
solicitation or offer to buy or sell any securities or related financial
instruments.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to