in reply to Ternary inside a regex
You can do that using the /e modifier:
Igor S. Lopes - izut
surrender to perl. your code, your rules.
$a = "size=1111"; $a =~ s/(\d+)/($1 > 5) ? 5 : $1/e; print $a, "\n"
Igor S. Lopes - izut
surrender to perl. your code, your rules.
In Section
Seekers of Perl Wisdom