By the way, your fixed is still broken. It only works if the calling package is one level away from the root. If the caller is Foo, it works. If the caller is Foo::Bar, it doesn't.
Using a symbolic ref is simpler than using %::.
my $pkg = do { no strict 'refs'; *{caller().'::'} };
In reply to Re^4: Mini-Tutorial: Working with Odd/Even Elements
by ikegami
in thread Mini-Tutorial: Working with Odd/Even Elements
by ikegami
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |