Ok, I'm done with the philosophical stuff. I forget where I read about the warning "...will not stay shared", so I'm going for the quick answer here.
I want to create a master dispatch table of all functions, and then
create another dispatch table that the child objects will see if the
config file entry is true.
This works:
{
my $num = 0;
sub callback {
return ++$num;
}
}
print callback() . "\n";
print callback() . "\n";
print callback() * 5 . "\n";
But attempting to wrap the block with a name generates the warning:
sub CONFIG_VAR {
my $num = 0;
sub callback {
return ++$num;
}
}
...as does this:
my $coderef = {
...and this:
my $coderef = sub {
Am I making this too hard on myself? I'm trying to generate global
functions that will append data at the base level, but want to have an
index for the master sub table, so I can retrofit the child objects with
only the subs that the config file states are necessary.
Steve
smime.p7s
Description: S/MIME Cryptographic Signature
