Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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

by btrott (Parson)
on Mar 07, 2001 at 09:49 UTC ( #62672=note: print w/replies, xml ) Need Help??

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

This is a bit shorter:
% perl -n -e 'sub f{map{push@_,shift;"@_"}@_}push@b,f split;END{$, +="\n";print sort@b}' filename
The actual code here (between the single quotes) is 72 chars. Though that's cheating slightly since you need the -n to make it work.

Should have the same output. I'm sure there's a faster/shorter way to do that f sub. Someone'll come up with it.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2016-10-28 08:02 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (377 votes). Check out past polls.