note
Jenda
<p>The objects are irrelevant in this case.</p>
<p>Maybe it'd be enough to local()ize the variables instead of insisting that they are lexical:</p>
<code>
{
our ($cont, $foo, $bar);
my %transformations = (
xxx => sub { use_the($foo,'and', $bar); as_you_need($cont); },
...
);
}
...
for my $xform (@{$self->{xforms}}) {
our ($cont, $foo, $bar);
local $foo = get_foo();
local $bar = get_bar();
local $cont = $container;
$transformations{$xform}->();
}
</code>
<p>I would not bother and just access <c>$_[0], $_[1] and $_[2]</c> within the transformations.</p>
<p>The only other option is a source filter and I bet you don't want to go there.</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-105128">
<p>Jenda<br>
<b>Enoch was right!</b><br/>
Enjoy the last years of Rome.
</p>
</div></div>
1002158
1002158