No. perldoc -f require :
... In other words, if you try this:require Foo::Bar; # a splendid barewordThe require function will actually look for the "Foo/Bar.pm" file in the directories specified in the @INC array.
But if you try this:
$class = 'Foo::Bar'; require $class; # $class is not a bareword #or require "Foo::Bar"; # not a bareword because of the ""The require function will look for the "Foo::Bar" file in the @INC array and will complain about not finding "Foo::Bar" there.
In this case you can do:
eval "require $class";...
Personally, I've used UNIVERSAL::require, which allows me to do
"Win32::Service"->require()
but I don't think that UNIVERSAL::require is really fit for production use.
In reply to Re^3: Can we do "use Win32:Service" on Unix ?"
by Corion
in thread Can we do "use Win32:Service" on Unix ?"
by ajith
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |