On Fri, 2002-04-05 at 09:30, Luke Palmer wrote:
> On 4 Apr 2002, Aaron Sherman wrote:
> > $z = interpolate interpolate $y;
> >
> > Then you have ultimate control.
>
> Uhm, I disagree. I think you really get ultimate control _without_
> interpolate. Some people might want to make \\t interpolate to tab, and
> some would not. The syntax is simple enough for simple s///'s to take care
> of it. And you could say
> die "Can't interpolate expressions" if /$\(/;
> And things like that. I think its fine.
Sorry, I guess I have to define my terms.
By ultimate control, I meant that if you have an interpolate command,
you can then do whatever you want at each stage. You could do:
$z = interpolate interpolate $y;
or
$z = interpolate $y;
$z =~ s/\\/\\\\/g;
$z = interpolate $z;
or
$z = interpolate $y;
die "WOOGA!" if $z =~ /\$\(/;
$z = interpolate $z;
or whatever. You can do whatever you want. This is faster and more
efficient (I would hope) than:
$z = eval qq{"$y"};
because you don't have to go through the parser unless the interpolation
invokes an eval.