more useful options | |
PerlMonks |
Re^3: inconsistent module access (require vs use)by LanX (Saint) |
on Jun 25, 2022 at 10:18 UTC ( [id://11145033]=note: print w/replies, xml ) | Need Help?? |
My most esteemed brethren choroba and HaukeX already nailed down your problem. But you seem to be confused about the difference between use and require from the docs
use ModuleImports some semantics into the current package from the named module, generally by aliasing certain subroutine or variable names into your package. It is exactly equivalent to BEGIN { require Module; Module->import( LIST ); } except that Module must be a bareword. ...
BEGIN happens at compile-time, if you want to use a module at run-time, you always need to call ->import too. It's also an FAQ, plz see --> What's-the-difference-between-require-and-use? and plz follow the various links embedded in this node to round up the picture.° HTH! :) Cheers Rolf °) well you could already have followed some of them before
In Section
Seekers of Perl Wisdom
|
|