Perl: User Defined Functions
sub funny_print {
my ($name, $age) = @_;
print <<END_FUNNY_PRINT;
The person\’s name is $name,
and the age is $age.
END_FUNNY_PRINT
return 1;
}
funny_print ("Abe", 50); # or
&funny_print ("Abe", 50); # or
funny_print "Abe", 50;
# This last form is OK AFTER the defn.
Previous slide
Next slide
Back to first slide
View graphic version