Perl programming on mMPE/iX - August 2001
HP World Page 11August 21, 2001
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