On the contrary, the warning
does occur under perl 5.6.1 on Linux, as well as perl 5.6.0 and perl 5.7.1. Are you sure you had warnings turned on for all your tests?
The warning doesn't occur in 5.005_03 because the warning wasn't implemented until 5.6.0. :)
Anyway, this warning is actually produced at the end of the compile phase, after the entire script has been compiled:
warn "About to call\n";
mysub(1);
warn "Called\n";
BEGIN {
package Foo;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(mysub);
sub mysub ($) { warn "mysub: @_\n" };
}
BEGIN {
warn("About to import\n");
Foo->import();
warn("Imported\n");
}
CHECK { warn "Done compiling.\n" }
INIT { warn "Running.\n" }
__END__
About to import
Imported
main::mysub() called too early to check prototype at tmp.pl line 4.
Done compiling.
Running.
About to call
mysub: 1
Called
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.