laziness, impatience, and hubris | |
PerlMonks |
require in script breaks moduleby chrstphrchvz (Scribe) |
on Mar 02, 2019 at 16:33 UTC ( [id://1230761]=perlquestion: print w/replies, xml ) | Need Help?? |
chrstphrchvz has asked for the wisdom of the Perl Monks concerning the following question: Howdy Monks, 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: funnybusiness.pm:
test.pl:
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.)
Back to
Seekers of Perl Wisdom
|
|