Gossamer Forum
Home : General : Perl Programming :

Can 'chomp' strip last byte of a FILE?

Quote Reply
Can 'chomp' strip last byte of a FILE?
is it possible to chomp the last byte of a file? I want to remove a control-Z character (hex 1a) from the end of a file. I
can do it by reading the file line-by-line, but the file is huge, over
50Mb and it takes too long. Does anyone know if there is a quick way
to strip off that stupid control-Z? thanx!
Quote Reply
Re: Can 'chomp' strip last byte of a FILE? In reply to
No.

But you can chop the last bit of a file.

chop(whatver); <-- removes the last character of of the file.

------------------
Ryan Brown
fpsn.net, Inc.
rbrown@fpsn.net