in reply to Switching the Order of Lines
If you reverse the line order and the order of characters within your lines, it should do the trick (if I understood what you are looking for). This is a Perl one-liner used on one program random file sitting in my main directory:
$ perl -e '@c = reverse <>; for (@c) {$d = reverse $_; print $d}' coderef.plOn my file, I get the following reesult
;)f$(evitatnet } ;))0 == ruoter_edoc$( && ) 1 => sevitatnet_bn$(( elihw } ;--sevitatnet_bn$ ;ruoter_edoc$ tnirp ;))(>-g$( lave = ruoter_edoc$ ym { od ;3 = sevitatnet_bn$ ym ;tfihs = g$ ym { evitatnet bus ;};"otot" tnirp{ bus = f$ ym ;sgninraw esu ;tcirts esu
The last line above is a reverse 'use strict;' line that was at the beginning of my file.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Switching the Order of Lines
by hdb (Monsignor) on Oct 29, 2013 at 07:31 UTC | |
by Laurent_R (Canon) on Oct 29, 2013 at 16:16 UTC |