Apologies if I'm misunderstanding something here, but isn't the following code assigning to a glob?True, but that wasn't what I was referring to. The above is only executed once. The concern was with the following line in the original code that was executed every time the method was called:*{$package . "::" . $name} = sub :lvalue {
By removing that line, my suggested code should not suffer from the method cache reset performance penalty that occurs each time the method in the original code is called.local *call = sub { $self->{$name}->(@_); };
In reply to Re^6: defining methods on the fly
by jdhedden
in thread defining methods on the fly
by flogic
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |