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

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

by btrott (Parson)
on Mar 07, 2001 at 09:49 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-20 05:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found