develooper Front page | perl.perl5.porters | Postings from May 2013

[perl #117087] forbid empty parts in package names

From:
Father Chrysostomos via RT
Date:
May 26, 2013 07:52
Subject:
[perl #117087] forbid empty parts in package names
Message ID:
rt-3.6.HEAD-2650-1369554734-1117.117087-15-0@perl.org
On Thu Mar 07 20:29:25 2013, perl.p5p@rjbs.manxome.org wrote:
> * Jesse Luehrs <doy@tozt.net> [2013-03-07T16:42:45]
> > Foo:: has a documented meaning too - it's a form of quoting, so that
> > Foo::->new always means "Foo"->new, and never Foo()->new (which is the
> > default interpretation of Foo->new).
> > 
> > That said, I'm fairly sure that all of these forms are only being
> > deprecated in package statements - I don't see any reason why
> > "package ::X" or "package X::" are reasonable things to do.
> 
> More importantly, in package names, even if the practical effect is
largely
> through the "package" statement.  It doesn't affect the meaning of $::x or
> Foo::
> 
> $x::::y is right out, though.

But why? Is it harmful? I actually find $x::::y useful, as ‘use
Foo::::Bar’ vs ‘use Foo::Bar’ actually lets me have two separate import
subs in the same module.

It may be uncommon, but I have actual code using that.

Also, arbitrary string are currently allowed for ${"..."}.  I hope
*that* doesn’t change!

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=117087



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About