in reply to Re: Autovivification with require
in thread Autovivification with require
From the documentation for require
In other words, if you try this:
The require function will actually look for the Foo/Bar.pm file in the directories specified in the @INC array, and it will autovivify the Foo::Bar:: stash at compile time.
But if you try this:
The require function will look for the Foo::Bar file in the @INC array and will complain about not finding Foo::Bar there. In this case you can do:
or you could do
Neither of these forms will autovivify any stashes at compile time and only have run time effects.
This seems to imply that there is some implicit advantage of one form over another because one autovivifies and the other does not - it was this part of the documentation that gave rise to my question...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Autovivification with require
by Fletch (Bishop) on Nov 20, 2020 at 16:34 UTC |