Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How to chomp the last new line character from the file

by jmcnamara (Monsignor)
on Nov 24, 2011 at 11:33 UTC ( #939855=note: print w/ replies, xml ) Need Help??


in reply to How to chomp the last new line character from the file

Here is one way:

perl -i -pe 'chomp if eof' file1 file2 ...

--
John.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://939855]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2016-07-30 21:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (268 votes). Check out past polls.