Object-InsideOut - Re: :Restricted methods imported into child classes?

Posted on Wed Jan 18 18:59:46 2006 by je44ery in response to 1637 (See the whole thread of 9)
Re: :Restricted methods imported into child classes?
Not sure if I'm misunderstanding, but I'm pretty sure that :Restricted and :Private *do* work on functions. I'm not sure if you intended this, but it works, and I like it that way. If you take away that functionality because it is not architecturally correct, then please let me know.

These 3 source files:
$ cat PPP.pm package PPP; use Object::InsideOut; sub _thisone : Private { print "This works!\n"; } 1; $ cat CCC.pm package CCC; use Object::InsideOut qw(PPP); sub pubby { PPP::_thisone(); } 1; $ cat test_inherit.pl #!/usr/bin/perl -w use warnings; use strict; package main; use CCC; my $obj = CCC->new(); $obj->pubby();

Give me this result:
# ./test_inherit.pl OIO::Method error: Can't call private method 'PPP->_thisone' from class 'CCC' Package: CCC File: CCC.pm Line: 5 Trace begun at CCC.pm line 5 CCC::pubby('CCC=SCALAR(0x3024f290)') called at test_inherit.pl line 13
Write a response