Perl: the Markov chain saw | |
PerlMonks |
Re: Re: Removing Control Characters from a Fileby jmcnamara (Monsignor) |
on Jun 04, 2002 at 22:57 UTC ( [id://171669]=note: print w/replies, xml ) | Need Help?? |
Very nice. This merits a closer look:
So in effect this splits the file into records divided by ^X, chomps ^X from the end of each record and prints out the records with 0777 appended at the end. However, (and I'm not certain about this) since there is no character with that value it actually appends ''. Thus, the ^X's are removed from the file. So in a way the program is functionally equivalent to: perl -i -pe 's/\30//g' file I say functionally equivalent since there is no aesthetic equivalence. :-)
--
In Section
Seekers of Perl Wisdom
|
|