in reply to Compile time action of require in 5.10.1??
This will give you part of the answer:
$ perl -E'if (0) { require Foo::Bar } say for keys %Foo::' Bar::
A require PackageName statement creates an empty stash for the package at compile time, even if the statement never gets executed.
The next part of the answer is in gv.c, the Perl_newIO function. Part of what this function does is to check whether the FileHandle package exists (and it does this by checking whether the stash exists!) and if not, aliases it to IO::Handle.
It's all pretty dumb. The situation was improved in 5.12, and as of 5.14 works sanely.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Compile time action of require in 5.10.1??
by djerius (Beadle) on Feb 06, 2014 at 22:16 UTC |