in reply to Extra spaces

This line will remove all whitespace from the end of every element in @lines.

s/\s+$// for @lines;

Replies are listed 'Best First'.
Re: Re: Extra spaces
by chip (Curate) on Jun 19, 2003 at 21:37 UTC
    Works great, but also deletes newlines. In case the newlines are needed:

    s/[ \t]+$// for @lines;

        -- Chip Salzenberg, Free-Floating Agent of Chaos