[Israel.pm] package/sub ambiguity

Yitzchak Scott-Thoennes sthoenna at efn.org
Sun Jun 1 12:38:19 PDT 2008

On Sun, June 1, 2008 12:25 pm, Shmuel Fomberg wrote:
> I did: $r = Repeater->create(...);
> I actually got: $r = (&Repeater())->create(...);

Yes, if there's a sub Repeater declared at the time the method call is
compiled, it will get called; if there's not, it's autoquoted for you.

> A way to resolve that was to write:
> $r = "Repeater"->create(...);
> Any advice from the community? I actually liked the sub-package name
> duality.

I like $r = Repeater::->create(...);

More information about the Perl mailing list