in reply to Re^2: golf: shortest way to parse a pipe delimited file
in thread golf: shortest way to parse a pipe delimited file

my command line doesn't like it at all

Then adapt it to your shell. Something like this might work,

perl -anF'|' -le'$f{shift@F}=[@F[1..$#F]]' pipe.txt

but I don't use your shell so that is a guess, and I cannot test it as it wouldn't work on my shell.

This is how you'd score it:

That doesn't seem quite fair, as to use your example, you would need at least this to make it work:

#!/usr/bin/perl #12345678901234567890123456789012345678901234567890123456789012345 open SRC, '<pipe.txt';%prod=map{chomp;split/\|/;shift@_,[@_]}<SRC>

Which I get to be a total of 89 and that's without the command line to run it!


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^4: golf: shortest way to parse a pipe delimited file
by bageler (Hermit) on Nov 12, 2005 at 22:22 UTC
    the context is that of a subroutine though. You go out of context and the rules change ;)