shan_emails has asked for the wisdom of the Perl Monks concerning the following question:
use strict; our $aa=10; our $vv=20; my $x='asdf <add>$aa + $vv</add> asdf '; $x =~ s/<add>(.*?)<\/add>/process($1)/gsei; print $x; sub process(){ my $var = shift; print $aa; print $vv; print $var; #here i need to variable interpolate the $var string }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: variable interpolation
by GrandFather (Saint) on Feb 12, 2009 at 20:18 UTC | |
by Anonymous Monk on Feb 27, 2009 at 12:42 UTC | |
by GrandFather (Saint) on Feb 27, 2009 at 20:56 UTC | |
by Anonymous Monk on Feb 28, 2009 at 06:58 UTC | |
by GrandFather (Saint) on Feb 28, 2009 at 07:22 UTC | |
|
Re: variable interpolation
by jethro (Monsignor) on Feb 12, 2009 at 15:38 UTC | |
|
Re: variable interpolation
by MidLifeXis (Monsignor) on Feb 12, 2009 at 15:39 UTC | |
by shan_emails (Beadle) on Feb 12, 2009 at 15:46 UTC |