Please send questions to
st10@humboldt.edu .
package MyFirstModule;
use warnings;
use Exporter;
our @ISA = qw(Exporter);
#-----------------------------------------------------------
# identification comments
#
# this is package MyFirstModule.pm.
# inspired by "Practical Perl with CGI Applications"
# by E. Chang, Scott/Jones Publishing, pp. 153-159
# by: Sharon M. Tuttle
# last modified: 11-16-04
#------------------------------------------------------------
# description comments
# three subroutines: first_sub, second_sub, third_sub.
#
# first_sub is AUTOMATICALLY exported, and expects one
# parameter (although it doesn't barf if given more).
# It notes that it has been called and echoes its
# argument.
#
# second_sub is exported on request, and takes no
# arguments. It notes that it has been called.
#
# third_sub is not exported. Can it be called with pkg::sub
# notation, or is it "invisible"? It takes no arguments,
# and notes that it has been called.
#-------------------------------------------------------------
# first_sub is AUTOMATICALLY exported, and expects one
# parameter (although it doesn't barf if given more).
# It notes that it has been called and echoes its
# argument.
sub first_sub
{
my $param = $_[0];
print "CALLED first_sub with $param in MODULE MyFirstModule\n";
}
#----------------------------------------------------------
# second_sub is exported on request, and takes no
# arguments. It notes that it has been called.
sub second_sub
{
print "CALLED second_sub in MODULE MyFirstModule\n";
}
#--------------------------------------------------------------
# third_sub is not exported. Can it be called with pkg::sub
# notation, or is it "invisible"? It takes no arguments,
# and notes that it has been called.
sub third_sub
{
print "CALLED third_sub in MODULE MyFirstModule\n";
}
# what can and cannot be exported?
#our @STD = qw(first_sub second_sub);
our @EXPORT = qw(first_sub);
our @EXPORT_OK = qw(second_sub);
# for GOOD STYLE, include this at the end of a module.
return 1;