Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2014-08-22 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (153 votes), past polls