Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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.

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

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 chanting in the Monastery: (2)
As of 2015-10-05 02:40 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (106 votes), past polls