All you're missing is the /e modifier, see perlre.
$page =~ s/\$galleryname/galleryname()/ge
In reply to Re: Regex to replace $vars with subroutine
by Corion
in thread Regex to replace $vars with subroutine
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |