$ time ./script.pl dict.txt
Num. Line : 185866729 - Occ : 14900
real 0m39.453s
user 0m38.999s
sys 0m0.445s
$ perl -v
This is perl 5, version 16, subversion 2 (v5.16.2) built for darwin-th
+read-multi-2level
(with 3 registered patches, see perl -V for more detail)
Mac OS X 10.9.5, Intel Core i7 2.4 GHz, 16 GB RAM 1600 MHz DDR3
You can shove some time off getting rid of $counter and using $. instead, a quick test took about 6 seconds less in my configuration.
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
Io ho capito... ma tu che hai detto?