in reply to documentation best practices for internal modules
I'm with the others; document everything. Because that's been covered, I'll leave it alone.
If you don't want your internal modules/subs being used by external code, you can catch that. Here's a rudimentary example:
use warnings; use strict; package Internal; { sub foo { my $caller = (caller(1))[3]; my $me = (caller(0))[3]; if ($caller !~ /^Internal::/){ die "$me is only available internally\n" } ... } } package External; { sub bar { Internal::foo(); } } package main; External::bar(); __END__ Internal::foo is only available internally
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: documentation best practices for internal modules
by Anonymous Monk on Jan 08, 2018 at 22:44 UTC |