perlquestion
kiat
Hi all,<p>
Is it possible to have a ternary expression within the replacement bit of the regular expression? I've the following code and I'm trying to fix the size of font (captured in $1) if it's greater than 5:
<code>
$message =~ s~\[size=(.+?)\](.+?)\[/size\]~'<font size="' . $1 . '">' . "$2</font>"~eisg;
# I'm trying to test $1 so that if it's greater than 5,
# fix it at 5, else leave it unchanged.
</code>
Thanks in advance :)