On Sun Jan 01 13:14:40 2012, sprout wrote:
> *{""} stringifies as *main::. But *main:: stringifies as
> *main::main::.
>
> So it doesn’t round-trip properly.
>
> I wonder what is the best way to fix this, or where there is any way
> that wouldn’t break anything.
>
> This oddity makes Data::Dumper more complex that it would be
> otherwise.
I think the only way to fix this properly is to make *{$foo} equivalent
to *{__PACKAGE__ ."::$foo"} in all cases where $foo is a string that
does not contain a package separator.
That means that %{""} will refer to %:: in the main package, and to
%foo:: in the foo package.
--
Father Chrysostomos
Thread Next