On Mon May 14 13:02:58 2012, tom christiansen wrote:
> Matt S Trout <mst@shadowcat.co.uk> wrote
> on Mon, 14 May 2012 14:18:44 BST:
>
> > I'm not sure what you mean; as I mention above, => is a comma
> > that, if its left hand side is a valid bareword, implicitly
> > quotes it.
>
> "Valid bareword" sounds a bit funny. In Perl, a "bareword" is
> just an identifier token sufficiently ambiguous to be deemed
> illegal under strict subs, and to be a literal string otherwise.
>
> $when{time} = date; # one bareword, "date"
> $when{date} = time; # no barewords at all
>
> When autoquoted, it is not a bareword. Is that perhaps what you
> meant by "valid bareword"?
If we are to be that strict in our use of the term, then this
documentation for require from perlfunc needs to be corrected, as
require does its own autoquoting, and goes even further than => by
allowing double colons as well:
If EXPR is a bareword, the require assumes a "F<.pm>" extension and
replaces "F<::>" with "F</>" in the filename for you,
to make it easy to load standard modules. This form of loading of
modules does not risk altering your namespace.
In other words, if you try this:
require Foo::Bar; # a splendid bareword
The require function will actually look for the "F<Foo/Bar.pm>" file in the
directories specified in the C<@INC> array.
--
Father Chrysostomos
---
via perlbug: queue: perl5 status: rejected
https://rt.perl.org:443/rt3/Ticket/Display.html?id=112914
Thread Previous
|
Thread Next