+use Math::BigInt lib => "GMP", ":constant";

+The palindromic number 595 is interesting because it can be written as the sum

+of consecutive squares: 6^2 + 7^2 + 8^2 + 9^2 + 10^2 + 11^2 + 12^2.

+There are exactly eleven palindromes below one-thousand that can be written as

+consecutive square sums, and the sum of these palindromes is 4164. Note that 1

+= 02 + 12 has not been included as this problem is concerned with the squares

+Find the sum of all the numbers less than 108 that are both palindromic and can

+be written as the sum of consecutive squares.

+# my $limit = shift(@ARGV);

+my $limit = 100_000_000;

+my $sqrt_limit = int(sqrt($limit));

+foreach my $start (1 .. $sqrt_limit)

+ foreach my $end (($start+1) .. $sqrt_limit)

+ if (scalar(reverse("$sum")) eq "$sum")

+ if (! $found{"$sum"}++)

+print "Sum found = $sum_found\n";