in reply to perl sort versus Unix sort
This reply does not solve OP's problem, but... A bit of white space would have been much appreciated in the first line of btree() (which assigns TONS of variables) and the $pcode assignment. Something like...
sub btree { # I personally would much prefer hash reference(s) here my ( $disk , $workdir , $outFileName , $sep , $keyMap_aref , $verbose , $infile_aref , $indir , $outdir , $splitSize , $keyPos_aref , $outCol_aref ) = @_ ; ... # No need for "$pcode" & later "eval $pcode" # Use "$parse->($line)" as you already have my $parse = make_parse_code( $sep , $splitSize , $keyPos_aref ); ... } sub make_parse_code { my ($sep , $size , $items) = @_; return sub { my ($line) = @_; join $sep , ( (split /$sep/ , $line , $size)[@$items] ); }; }
...adjust to your liking. Well, lack of white space was bugging me much, so i adjusted the code; i am sure others [cw]ould point out other improvements/suggestions.
|
|---|