Please send questions to
st10@humboldt.edu .
#!/usr/bin/perl -w
#######################################################
# lect03_return2
#
# shows what my_first_subroutine, greeter actually return
#
# modified by Sharon Tuttle from "Learning Perl",
# by Schartz and Phoenix
#
# last modified: 9-6-04
#######################################################
#-------------------------------------------------
# WHEN CALLED, just prints a message of success
#-------------------------------------------------
sub my_first_subroutine
{
print "**************************\n";
print " MY FIRST PERL SUBROUTINE\n";
print "**************************\n";
}
#--------------------------------------------------------
# prints a customer greeting that also counts customers
#--------------------------------------------------------
sub greeter
{
$cust_num += 1;
print "\n***** Welcome to Perl-mart! *****\n";
print "Hello, you are customer #$cust_num today!\n";
print "*********************************\n\n";
}
#-------------------------------------------------------
# script actually starts executing here
#-------------------------------------------------------
print "\nscript starts executing here!\n\n";
$val1 = &my_first_subroutine();
print "\nmy_first_subroutine returned: $val1\n";
$val2 = &greeter();
print "greeter returned: $val2\n\n";
# end of lect03_return2