in reply to Re: Regex to replace $vars with subroutine
in thread Regex to replace $vars with subroutine
# prints "hello therethis is a test1use warnings; use strict; my $string = "this is a test \$placeholder"; $string =~ s/\$placeholder/test_sub()/e; print $string; sub test_sub { print "hello there"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Regex to replace $vars with subroutine
by kyle (Abbot) on Jun 07, 2008 at 01:19 UTC |