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

I see more than 41 characters because you say while (<SRC>) { } In my solution, the filehandle is part of the solution character count. If I put my solution in the context of yours it looks like this:
sub parse{ #12345678901234567890123456789012345678901234567890 %p=map{chomp;split/\|/;shift@_,[@_]}@_ } parse(<SRC>);
and is 37 characters.

Replies are listed 'Best First'.
Re^3: golf: shortest way to parse a pipe delimited file
by Roy Johnson (Monsignor) on Nov 10, 2005 at 20:06 UTC
    Save a couple of chars by taking advantage of the fact that shift defaults to @_ while in a sub.
    %p=map{chomp;split/\|/;shift,[@_]}@_
    Using chop instead of chomp would help, but might not be portable.

    Caution: Contents may have been coded under pressure.