answer to project euler question #2 in Perl