http://www.perlmonks.org?node_id=287198


in reply to Better Way to Do it 2

and still shrinking

perl -pi -e '$_=reverse'

Update: yep as MarkM points out this reverses each line, not the order of lines :(.

Replies are listed 'Best First'.
Re: Re: Better Way to Do it 2
by MarkM (Curate) on Aug 28, 2003 at 15:59 UTC

    Unless I'm missing something, your solution doesn't work. You are using reverse in scalar context, which reverses the order of the string, not the order of the lines.