Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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

by casiano (Pilgrim)
on Jan 18, 2008 at 13:41 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://663057]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-16 12:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found