in reply to RE: Re: Dreaming of Post Interpolation
in thread Dreaming of Post Interpolation
Unless I misunderstand what you're asking for; you can do the
assignment multiple times with
different values:
My technique will also work for your number example (with everything stored as a function). However it look slightly ugly:$text = sub { <<EOT; Dear $person, I know that this text is $adjective. But I wish it could be... EOT }; my @subs=('Mom:not interpolates', 'Dad:maybe interpolated', 'Sis:who knows'); foreach (@subs){ local ($person,$adjevtive)=split ':',$_; print &$text; }
$n = sub {1}; $m = sub {&$n*2}; $o = sub {&$m*2}; $s = sub {&$n." ".&$m." ".&$o."\n"}; print &$s; $n = sub {2}; print &$s;
In Section
Seekers of Perl Wisdom