Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Key Word In Context system (golf, anyone)?

by jmcnamara (Monsignor)
on Mar 27, 2001 at 17:34 UTC ( #67482=note: print w/ replies, xml ) Need Help??


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.
--


Comment on Re: Key Word In Context system (golf, anyone)?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://67482]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (17)
As of 2015-07-29 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls