in reply to Function call inside regexp
mickeyn has already given you the answer (use /e) but it's probably worth pointing out how you could have found that out for yourself.
s/// is an operator and therefore it is documented in perldoc perlop. In particular, it in the section about Rexexp Quote-Like Operators operators. This includes full documentation of the options and you'll see this:
e - Evaluate the right side as an expression.
Also there's an example (using sprintf) which is very similar to what you want.
No-one minds helping you out with questions like this (it is, after all what Perl Monks is here for) but you'll almost certainly get the answer much quicker if you learn to look through the documentation before asking here.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|