in reply to Undefined Subroutine Called
If you treated this package as a module, you would get to allow the package symbols to be exported to the current namespace and hence you would not need to qualify the subroutine call with the package name as in the previous snippet.use ClanBotFire; ClanBotFire->heyhey(); #or #&ClanBotFire::heyhey()
#"ClanBotFire.pm" package ClanBotFire; use lib "C:/Program Files/Perl Express/Scripts"; BEGIN{ use Exporter(); @ISA = qw(Exporter); @EXPORT = qw(&heyhey); } sub heyhey { print "hello world"; } 1;
use ClanBotFire; heyhey;
|
|---|