fletcher_the_dog has asked for the wisdom of the Perl Monks concerning the following question:
My problem is that some of these files have a "^Z" or "^A" character in the middle of them. When I slurp these files, the slurp stops at the "^Z" or the "^A", and I lose half the file. How do I get around this? Thanks!sub EditFile{ my $file = shift; open INFILE,$file; my $text = do{local $/;<INFILE>}; close INFILE; # edit text open OUTFILE,">$file"; print OUTFILE $text; close OUTFILE; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File Slurping Problem in Win32 machine
by Zaxo (Archbishop) on Sep 17, 2003 at 15:09 UTC | |
by fletcher_the_dog (Friar) on Sep 17, 2003 at 15:40 UTC | |
by Zaxo (Archbishop) on Sep 17, 2003 at 15:52 UTC | |
|
Re: File Slurping Problem in Win32 machine
by jmcnamara (Monsignor) on Sep 17, 2003 at 15:10 UTC | |
|
Re: File Slurping Problem in Win32 machine
by tcf22 (Priest) on Sep 17, 2003 at 15:35 UTC | |
|
Re: File Slurping Problem in Win32 machine
by jdtoronto (Prior) on Sep 17, 2003 at 15:12 UTC | |
|
Re: File Slurping Problem in Win32 machine
by tachyon (Chancellor) on Sep 18, 2003 at 04:42 UTC |