|Pathologically Eclectic Rubbish Lister|
require in script breaks moduleby chrstphrchvz (Scribe)
|on Mar 02, 2019 at 16:33 UTC||Need Help??|
chrstphrchvz has asked for the wisdom of the Perl Monks concerning the following question:
I have a test that I would like to skip if a requisite .ph file is not available, so I considered using:
However, doing require 'sys/ioctl.ph' from the test script "breaks" the module.
Here is a simplified equivalent:
Assuming sys/ioctl.ph is available, running test.pl prints the value of FIONREAD in sys/ioctl.h. But uncommenting the require statement in test.pl causes an Undefined subroutine &funnybusiness::FIONREAD error.
(Actual module for anyone curious:
The module makes use of AUTOLOAD, meaning I get something more wacky than a Undefined subroutine error.)