While that's true, that bit of the Camel refers to require Module;, not require "FileName";. In the first case, Perl will resolve a module name to a file path. In the second case, Perl will treat the string as a file path and attempt to resolve it accordingly. (I don't have the source in front of me, so I'll wave my hands over some DWIMmery — there may be a Perl_looks_like_plain_module_name() macro in play there.
To solve the original poster's problem, either solution one or two will work:
# solution 1 use lib '/path/to/bar/parent/directory'; use Bar; # solution 1b use lib '/path/to/bar/parent/directory'; BEGIN { require Bar; Bar->import(); } # solution 2 BEGIN { require "/path/to/bar/parent/directory/Bar.pm"; Bar->import(); }
In reply to Re: Re: Question regarding "require" or "use"
by chromatic
in thread Question regarding "require" or "use"
by freddo411
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |