NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Or stay out of the symbol table altogether (Score:1)
Re: (Score:1)
_get($self, %args);
is by re-declaring the whole sub:
no warnings 'redefine';
sub That::Module::_get {
die "with pain";
}
which is *way* far from what I consider "fair use of the _
Re: (Score:1)
Well it’s not really about safety. It’s about namespacing. If you subclass another class, declaring a
_getof your own is not safe because you don’t know whether the superclass has declared such a “private” method itself (or will declare one in a future version), and call it using$self->_getand thus accidentally invoke yours instead.Using lexicals ensures real encapsulation – not in the sense that you want to keep out people bent on getting in, but in the sense of
Re:Or stay out of the symbol table altogether (Score:1)
Reply to This
Parent