It depends on the operating system or resp. file system.
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.
°) QUESTION: Where did you test that code???
|