How about this?
for ( 99999 .. 999996 ){
print "$_\n" if is_palindrome( $_, 2, 4 )
and is_palindrome( $_ + 1, 1, 5 )
and is_palindrome( $_ + 2, 1, 4 )
and is_palindrome( $_ + 3, 0, 6 );
}
sub is_palindrome {
( $number, $start, $len ) = @_;
$str = sprintf("%06d", $number );
return...