in reply to Visibility of Subroutines within modules,

You could use miyagawa's Attribute::Protected module which let's you implement C++/Java style encapsulation on your methods.
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

HTH

broquaint

Replies are listed 'Best First'.
Re: Re: Visibility of Subroutines within modules,
by ceedee (Sexton) on Mar 25, 2002 at 23:59 UTC
    Thanks to all the replies, I'll have a look at both techniques mentioned. ceedee