in reply to Re^3: Using Exporter module
in thread Using Exporter module
It is possible to make subroutines un-callable from a scope, it just makes the code uglier :-)
package Whatever; { # anything outside this scope can't call this: my $private1 = sub { print "hello"; }; # everybody can call Whatever::foo sub foo { $private1->(); # call private method print " world\n"; } } foo();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Using Exporter module
by ikegami (Patriarch) on Jul 19, 2007 at 14:32 UTC |