What I have done in the past is to store things into a variable before printing the output. If the file isn't drastically huge, this won't be a problem:
# Just a snippet -- assume variables decared, etc. while(<FILE>) { $out =~ s/\x1a//; } print $out;

--Coplan


In reply to Re: File end marker problem by Coplan
in thread File end marker problem by DaveKelly

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":