my @x; while (/(?=((\d)(\d)))/g) { push @x, $1 if $3 > $2; }