jroberts has asked for the wisdom of the Perl Monks concerning the following question:
subdir is a directory directly under my current directory and directory where the script resides. @INC contains '.' If I do the following...use subdir::Somemodule qw(%myhash); print join ("\n", keys %myhash), "\n"; __END__
Perl finds the module, but the import function is not called and %myhash in main is empty (which it is not in Somemodule.pm) However if I change the code above to the following...$>perl -I. import_test.pl
Everything is a-ok. Furthermore, if i change the code to be...use subdir::Somemodule; import Somemodule qw(%myhash); print join ("\n", keys %myhash), "\n"; __END__
And invoke perl as follows...# delete the 'subdir' from the use # use Somemodule qw(%myhash); print join ("\n", keys %myhash), "\n"; __END__
This also works. Any ideas? Here's the version of perl i'm running on Win 2000 Pro.$> perl -I 'subdir' importest.pl
Thanks in advance, jrThis is perl, v5.6.1 built for MSWin32-x86-multi-thread
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Bug? import function
by wog (Curate) on Sep 13, 2001 at 03:17 UTC | |
by jroberts (Acolyte) on Sep 13, 2001 at 04:05 UTC | |
by wog (Curate) on Sep 13, 2001 at 04:17 UTC | |
by jroberts (Acolyte) on Sep 13, 2001 at 04:28 UTC | |
|
Re: Perl Bug? import function
by dragonchild (Archbishop) on Sep 13, 2001 at 17:04 UTC |