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


in reply to Function call inside regexp

Hi Luca,

use the /e modifier to evaluate the right-hand side of the RE.

$b =~ s/\:\:/File::Spec->rootdir()/e ;

Enjoy,
Mickey