Perl script for stats