>>>>> "CD" == C DeRykus <dery...@gmail.com> writes:

  CD> On Jul 21, 3:42 pm, u...@stemsystems.com ("Uri Guttman") wrote:
  >> 
  >>         perl -pe 's/(\S+)\s+(\S+)/$2 $1/' file
  >> 

  CD> Since the weather's good for golf...

i was vaguely hinting at golf but i wanted a fairly normal looking
solution as well!

  CD> perl -pale ' $_=join " ", reverse @F' file

that is longer than mine!

  CD> perl -ple   ' /\s+/;$_="$'  $`" ' file

what if there are leading or trailing spaces in the data source! :)

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to