#!/usr/bin/perl -w

#######################################################
# class4_09_my1
#
# using lexical variables 
# 
# modified by Sharon Tuttle from "Learning Perl",
#    by Schartz and Phoenix
#
# last modified: 4-17-03
#######################################################

sub greeter2
{
    my($cust_num);
    $cust_num += 1;

    print "\n***** Welcome to Perl-mart! *****\n";
    print "Hello, you are customer #$cust_num today!\n";
    print "*********************************\n\n";
}

# call greeter2 several times, see what happens

&greeter2;
&greeter2();

# any $cust_num here is DIFFERENT from that inside $greeter2

print "\$cust_num: $cust_num\n";
$cust_num = 53;
print "changed \$cust_num to: $cust_num\n";

# ...and so can greeter:

&greeter2();



# end of class4_09_my1
