PERL BEGINNERS 25 RE QUESTIONS OF OOP IN PERL
Subject: Re: Questions of OOP in Perl
Date: Fri, 8 Aug 2003 12:04:00 +0000

From: pablo@no-spam (Pablo Fischer)

Thanks!

After sending my question I found in a website the topic of 'private' methods, and shows code like this:

my $method_name = sub {
my $this = shift;

_blablabla_
};

And to access it :

$this->$method_name("Arg1");

Now, this it really works for 'private' methods?

Thanks!
-- Pablo Fischer Sandoval (pablo@no-spam http://www.pablo.com.mx http://www.debianmexico.org GPG FingerTip: 3D49 4CB8 8951 F2CA 8131 AF7C D1B9 1FB9 6B11 810C Firma URL: http://www.pablo.com.mx/firmagpg.txt

Date: Tue, 12 Aug 2003 22:34:25 -0700

Subject: Re: Questions of OOP in Perl
From: rjnewton@no-spam (R. Joseph Newton)
Pablo Fischer wrote:

> Thanks!
>
> After sending my question I found in a website the topic of 'private' methods,

> and shows code like this:
>
> my $method_name = sub {
> my $this = shift;
>
> _blablabla_
> };
>
> And to access it :
>
> $this->$method_name("Arg1");
>
> Now, this it really works for 'private' methods?
>

Perl has no private methods. Only polite conventions concerning which methods should be called from outside the pm file. One way to communicate this is simply
to document only public methods using the emedded donumentation format, and use standard comments for any necessary explanation of internal methods.

Joseph