http://qs1969.pair.com?node_id=67482


in reply to Key Word In Context system (golf, anyone)?

How about this, 45 bytes perl + 5 bytes for the pipe and sort:
perl -lane'for(@F){print"@F";push@F,shift@F}' file |sort

Or with an internal sort, 68 bytes:
perl -lane'for(@F){push@E,"@F";push@F,shift@F}END{print for sort@E}' f +ile

John.
--