in reply to Using Exporter module
Not exporting a sub doesn't prevent it from being called. Exporting simply allows you to do sub() instead of doing Module::sub(). Functions which aren't imported can still be called
Perl doesn't provide a means of making a function uncallable from outside of a namespace. There are ways of making it harder to call a function, but most programmers are satisfied to signal that a function is for private use by prepending an underscore (_) to its name.
Update: By the way, it's totally useless to export methods unless they can also be called as functions. It looks to me like you don't need Exporter at all.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Exporter module
by perlCrazy (Monk) on Jul 18, 2007 at 19:51 UTC | |
by ikegami (Patriarch) on Jul 18, 2007 at 20:04 UTC | |
by Joost (Canon) on Jul 18, 2007 at 22:45 UTC | |
by ikegami (Patriarch) on Jul 19, 2007 at 14:32 UTC | |
by perlCrazy (Monk) on Jul 19, 2007 at 12:42 UTC |