in reply to Calling locally manufactured (typeglob) methods
A trick is to make $method contain the package name explicitly:
That makes all tests pass. But again, I don't think numerical method names are a good idea.package GlobTest; BEGIN{ for my $method ( map { __PACKAGE__ . '::' . $_ } 0..9 ) { no strict 'refs'; *$method = sub { return $_ }; } } sub new { bless {}, shift }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Calling locally manufactured (typeglob) methods
by ysth (Canon) on Apr 05, 2007 at 16:37 UTC | |
by rhesa (Vicar) on Apr 05, 2007 at 18:34 UTC |