Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: REALLY Private Methods in perl: Is Perl Flexible enough to be made Inflexible?

by clintp (Curate)
on Sep 23, 2002 at 14:05 UTC ( #200097=note: print w/replies, xml ) Need Help??


in reply to REALLY Private Methods in perl: Is Perl Flexible enough to be made Inflexible?

One cheesy idea I've exploited: keep your methods as subrefs in a lexical hash in the module's file. Have AUTOLOAD take care of actually dispatching to the methods when they're called. The subs are unreachable outside of the module unless you pass a reference outside somehow.

It can make your code hard to read (and subclass, and...), but if all you want is privacy...

  • Comment on Re: REALLY Private Methods in perl: Is Perl Flexible enough to be made Inflexible?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://200097]
help
Chatterbox?
[Discipulus]: good morning monks
[choroba]: Morning!
[Corion]: Hi choroba, Discipulus!
[Corion]: Yesterday I've been mulling over how to best generate HTTP requests from permutations of values but I haven't found a nice API for passing in the "template" of the HTTP request yet. I guess I'll have to do a SoPW for that
[Corion]: The API itself will basically be my $iter = generate_http_requ ests(method => 'GET', url => '/settings/:name', headers => ???, get_params => ['foo','bar']), but I'm not sure how to parametrize values in the headers and how to specify lists of ...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2017-01-17 08:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (152 votes). Check out past polls.