in reply to How to tell if a sub has been exported?
About another question, making variable init as a closure is well-known idiom (see Ima::DBI which makes DB connection as a clusure) and you are not wrong about it IMHO.package Foo; sub foo { my $pkg = caller; if ($pkg ne __PACKAGE__ && defined &{$pkg."::foo"}) { # exported } else { # not } }
--
Tatsuhiko Miyagawa
miyagawa@cpan.org
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How to tell if a sub has been exported?
by rrwo (Friar) on Oct 06, 2001 at 08:26 UTC | |
by miyagawa (Chaplain) on Oct 06, 2001 at 12:04 UTC |