in reply to Re^2: Ternary inside a regex
in thread Ternary inside a regex
I think this way is easier to read:
Igor S. Lopes - izut
surrender to perl. your code, your rules.
message =~ s~\[size=(.+?)\](.+?)\[/size\]~"<font size=\"".(($1 > 5) ? +5 : $1)."\>$2</font>"~eisg;
Igor S. Lopes - izut
surrender to perl. your code, your rules.
In Section
Seekers of Perl Wisdom