in reply to Process large text data in array

I don't know if this makes things faster, but whenever I'm using split to split up data, I find it's usually easier to match what I want to keep:

foreach my $line (@arr) { if( $line =~ m/^([^=]+)=(.*)/ ) { my( $name, $value )= ($1,$2); $hashed{ $name }= $value; } else { warn "Unhandled line '$line'"; }; };

This approach also eliminates your substr gymnastics.

Replies are listed 'Best First'.
Re^2: Process large text data in array
by hankcoder (Scribe) on Mar 10, 2015 at 15:14 UTC

    Corion, you codes do speed up the process but only able to reduce just few seconds, making it total about 34sec to complete.