http://www.perlmonks.org?node_id=494505


in reply to Re^2: Ternary inside a regex
in thread Ternary inside a regex

I think this way is easier to read:
message =~ s~\[size=(.+?)\](.+?)\[/size\]~"<font size=\"".(($1 > 5) ? +5 : $1)."\>$2</font>"~eisg;


Igor S. Lopes - izut
surrender to perl. your code, your rules.