#!/usr/bin/env perl use strict; use warnings; use List::Util qw(max); # Functional # Imperative my $resp; for my $x (100 .. 999) { for my $y ($x .. 999) { my $cand = $x*$y; $resp = max($resp, $cand) if $cand eq reverse($cand); } } print "$resp\n";