I am trying to get my head around creating my own module. I have got the following out of the Perl Cookbook and am having some difficulties. I have gone through SuperSearch but have not been able to find my answers
Given the following module which I called Test.pm and located in the c:/perl/site/lib dir ...
use vars qw(@ISA @EXPORT);
my @ISA = qw(Exporter);
my @EXPORT = qw(
my $string = shift;
print &Time() . "- $string\n";
my @localdate = localtime(time);
my $tme = sprintf("%02d:%02d:%02d", $localdate, $localdate,
I am using the following code to try and call a subroutine and pass it a string(only for this VERY BASIC test)..
print "About to use Module\n";
&Prt("This is a test in the Mod");
This is what I get...
About to use Module
Undefined subroutine &main::Prt called at C:\dev\Source_Perl\MiscTests
+\mod.pl line 8.
I tried changing line 8. to
&Test::Prt("This is a test in the Mod");
as well as
Test::Prt("This is a test in the Mod");
as was suggested in a previous post but still get the same output.
Any help would be greatly appreciated.