On Mon, Jul 28, 2003 at 10:05:26AM -0500, Adam Thornton wrote:
> I believe the Perl function chomp does what you want.
>
> so:
>
> while (<>) {
>         chomp;
>         print;
> }

Nope, chomp() will only delete a single trailing \n.

For those who like to count rivets, what it really does is removes a
trailing string exactly matching the current value of the input record
separator as defined by the $/ variable -- which is set to "\n" unless
you've changed it yourself.  Other trailing whitespace won't be removed by
chomp.

Dave
--
 ('>  Dave O'Neill <[EMAIL PROTECTED]>,  Staff Scientist, Linuxcare, Inc.
 //\  tel: (613) 562-9949  fax: (613) 562-9304  http://www.linuxcare.com/
 v_/_          Linuxcare.  Simplifying Server Consolidation

Reply via email to