############################################## package J9Test; use strict; use warnings; use vars qw(@ISA @EXPORT); use Exporter; @ISA = qw(Exporter); @EXPORT = qw( Prt Time ); sub Prt { my $string = shift; print &Time() . "- $string\n"; } sub Time { my @localdate = localtime(time); my $tme = sprintf("%02d:%02d:%02d", $localdate[2], $localdate[1], +$localdate[0]); return($tme); } 1; ############################################## ############################################## #!/usr/bin/perl use strict; use warnings; use lib q{.}; use J9Test; print "About to use Module\n"; Prt("This is a test in the Mod"); print "Finished\n"; ##############################################
Damian Conway's Object Oriented Perl has one of the better explanations of how all this works.
I always highly recomend that book.
Wonko
In reply to Re: Undefined subroutine
by Wonko the sane
in thread Undefined subroutine
by J9
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |