On Mon, Oct 24, 2011 at 1:56 PM, chromatic <perlbug-followup@perl.org>wrote:
> # New Ticket Created by chromatic
> # Please include the string: [perl #102064]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=102064 >
>
>
> This is a bug report for perl from chromatic@wgz.org,
> generated with the help of perlbug 1.39 running under perl 5.14.1.
>
>
> -----------------------------------------------------------------
> [Please describe your issue here]
>
> perlmod describes the BEGIN form desugaring of use MODULE, but it
> does so incorrectly. It's trivial to write code which breaks the
> documented desugaring, while what Perl actually does works fine.
>
>
This patch corrects this documentation error.
>
What does that fix exactly? It seems to make things worse. What was a syntax
error is now valid but incorrect code.
>perl -e"sub Module { die } use Module;"
Original documented equivalent:
>perl -e"sub Module { die } BEGIN { require Module; import Module; }"
Bareword found where operator expected at -e line 1, near "import Module"
(Do you need to predeclare import?)
syntax error at -e line 1, near "import Module"
BEGIN not safe after errors--compilation aborted at -e line 1.
New documented equivalent:
>perl -e"sub Module { die } BEGIN { require Module; Module->import; }"
Died at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
Thread Previous
|
Thread Next