Front page | perl.perl5.porters |
Postings from September 2011
%^H etiquette
Thread Next
From:
Zefram
Date:
September 14, 2011 06:10
Subject:
%^H etiquette
Message ID:
20110914131031.GQ18211@lake.fysh.org
We don't have any established convention for how modules should name
their keys in the shared namespace of %^H. Sooner or later there's
going to be a clash. I think we should pick a convention that assigns
non-overlapping subsets of the namespace based on package names, and
document the convention in L<perlvar/%^H> and L<perlpragma>.
In my modules that use %^H, I've consistently used keys that begin with
the name of the module's main package followed by "/". Since "/" can't
be part of a package name, these names cannot clash with any other module
following the same convention. Each module has infinitely many names
available, by virtue of putting whatever it wants after its distinctive
prefix. The keys that are already used by the core do not fall within any
module's namespace under this scheme, because none of them contain "/".
I propose that this convention should be blessed. (I'm open to any other
convention that achieves the same effect, of course, but I hold out
a faint hope of forestalling bikeshedding by providing prior art that
can't be substantially improved upon.) I don't propose to change the
keys used by the core. However, if desired the core could start using
keys based on the "CORE" package name. That's logically a distinct step
from blessing and documenting the convention for modules.
-zefram
Thread Next