package SomeClass; use Attribute::Protected; sub new { return bless {}, shift } sub foo : Public { print "am in public foo()\n"; } sub bar : Private { print "am in private bar()\n"; } qq[end of package]; package main; $x = SomeClass->new(); $x->foo(); # fine - foo is public $x->bar(); # dies - bar is private
broquaint
In reply to Re: Visibility of Subroutines within modules,
by broquaint
in thread Visibility of Subroutines within modules,
by ceedee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |