Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by casiano (Pilgrim)
on Jan 18, 2008 at 08:41 UTC ( #663057=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    pl@nereida:~/LEyapp/examples$ cat localwithlocal3.pl
    #!/usr/local/bin/perl -w
    ...
    my $obj = Tutu->new();
    
    $obj->plim();
    
  2. or download this
    #!/usr/local/bin/perl -w
    use strict;
    ...
    # Let us provoke an exception
    Tutu::protected();
    
  3. or download this
    $ attributeprotectedwithlocal.pl
    Accessing 'protected' as a method: inside overwritten tutu!
    main does not even know of 'Tutu::protected'
    Accessing 'protected' as a method: inside overwritten tutu!
    Undefined subroutine &Tutu::protected called at ./attributeprotectedwi
    +thlocal.pl line 49.
    
  4. or download this
    pl@nereida:~/LEyapp/examples$ cat attributeprotected.pl
    #!/usr/local/bin/perl -w
    ...
    my $some = SomeClass->new;
    $some->foo;           # OK
    print ($some->can('_bar')?"Yes, main can see that SomeClass has a _bar
    + method\n":"no\n");
    
  5. or download this
    $ attributeprotected.pl
    Yes, main can see that SomeClass has a _bar method
    
  6. or download this
     94 my $attgram = new Language::AttributeGrammar <<'EOG';
     95
    ...
    114   my $res = $attgram->apply($t, 'val');
    115 }
    116 # Restored  old version of Language::AttributeGrammar::Parser::_ge
    +t_child
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://663057]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2020-04-01 06:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    To "Disagree to disagree" means to:









    Results (186 votes). Check out past polls.

    Notices?