On Mon, 8 Sep 2003 at 15:36, drieux opined:
drieux - since no one has responded, i'll take a stab at some of the
issues you bring up.
d:One of my first question is - why the 'closure' eg:
d:
d:{
d: package FOO;
d: ....
d:}
d:
d:Or is that simply to make 'clear' that outside of
d:the Closure it is still package 'main'???
from 'programming perl, 3rd edition', page 260:
closure gives us a way to set values used in a subroutine when you define
it, not just when you call it
so while i can see a reason for using closure like this:
{
my %REQ_PARAMS = {
action1 => { # some specifications for action1 },
action2 => { # some specifications for action2 },
etc....
};
sub req_params {
return $REQ_PARAMS{shift->action};
}
}
i'm not sure what the benefit of putting the whole damn package inside a
closure is. perhaps someone else can provide a reason or example of its
benefits?
d:Which leads me to my second set of question,
d:
d: as a general habit I tend to make 'private-ish' methods
d: with the "_" prefix such as
d:
d: sub _some_private_method { .... }
d:
d:is there some 'general access' mechanism by which one can
d:ask for the LIST of all methods that an 'object' CanDo???
not that i know of.
d:Or should one have a 'register_of_parser_methods' approach
d:that one can query?
i would guess most people probably list the available (public) methods in
the pod documentation.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]