in reply to How do I process multiple files in parallel?
Only if you encouter a "Cor" line (the last one of a block) handle the values you accumulated. And don't forget to clear them, just in case your input file is missing some lines.open (OUT,">Test")|| die; while (<>){ /^Sen = (\S+)/ && do {$sen=$1}; /^Acc = (\S+)/ && do {$acc=$1}; /^Cor = (\S+)/ && do {$cor=$1; push @array,$sen,$acc,$cor; $sen=$acc=$cor=undef; }; }'
|
---|