Perl programming on MPE/iX - February 2001

February 9, 2001
Solution Symposium
Page 10
hp e3000
perl
programming
subroutines
sub max {
my $max = shift(@_);
foreach $foo (@_) {
$max = $foo if $max < $foo; }
return $max;
}
$bestday = max($mon,$tue,$wed,$thu,$fri);
parameters passed via @_ array
@_[0] = parm1, @_[1] = parm2, etc
@_ is an alias (i.e. call by reference)
private variables declared with my
return or the value of the last expression is the functional
return value