$ perl -wMstrict -le 'print join(" ",map {int(rand(100))-50} 1..10) for 1..1000000' >in.txt $ time python list.py in.txt >pyout.txt real 0m1.964s user 0m1.934s sys 0m0.028s $ time perl 1190602.pl in.txt >out2.txt real 0m1.953s user 0m1.921s sys 0m0.028s