in reply to Perl code for finding shortest path not working on large files

This is dense code. I don't really want to untangle it to discover what it does. (It reminds me a bit of golf code.) Here are some random comments:

There is 1 almost useful comment:

# Hash table/dictionary for all the groups

...which doesn't explain much.

There are peculiar things, like:

sub oh { map values %$_, @_ }

which pulls the values out of a list of hashrefs. But then is used as:

ins @$_ for map {xtend $_, qw(P E Pl)} (oh oh oh \%T);

which assumes that there is a 3-level hash. Why not do all of that in the sub, and pass in a depth, or detect the depth?

Is the sample input the DATA?

ins split /,\s*/ for <DATA>;

How does it fail on the big file? Give a sample output where it's wrong (and right, if it's ever right).

-QM
--
Quantum Mechanics: The dreams stuff is made of

Replies are listed 'Best First'.
Re^2: Perl code for finding shortest path not working on large files
by zing (Beadle) on Jul 25, 2014 at 11:24 UTC
    Yes sample input is read in as <DATA>