in reply to Module name case typo silent failure
Your code creates a fatal error on Linux but (after adaption°) runs on Windows because the standard FS there is case-insensitive
Linux:
perl -MTime::Hires=time -Wle 'print time' Can't locate Time/Hires.pm in @INC
Windows:
C:\WINDOWS\system32>perl -MTime::Hires=time -Wle "print time" 1568923613
use is a require + import at compile time
BEGIN { require Module; Module->import( LIST ); }
That is it does a require of Time::HiRes (case-insensitive finds Hires.pm ) but fails to call Time::Hires->import() (Perl is case-sensitive)
Corion already explained that a missing ->import method doesn't create an error, and the typo'ed Module = package = Time::Hires has no ->import routine.
One might argue that the non-existence of the package Time::Hires should raise an error, probably you should file an error with perlbug.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
°) QUESTION: Where did you test that code???
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Module name case typo silent failure
by AnomalousMonk (Archbishop) on Sep 19, 2019 at 20:29 UTC | |
by LanX (Saint) on Sep 19, 2019 at 20:53 UTC | |
|
Re^2: Module name case typo silent failure
by LanX (Saint) on Sep 19, 2019 at 20:37 UTC | |
by Haarg (Priest) on Sep 19, 2019 at 22:53 UTC | |
by LanX (Saint) on Sep 19, 2019 at 23:04 UTC | |
|
Re^2: Module name case typo silent failure
by Anonymous Monk on Sep 19, 2019 at 21:17 UTC | |
by LanX (Saint) on Sep 19, 2019 at 21:31 UTC | |
by Anonymous Monk on Sep 19, 2019 at 22:10 UTC |