Fetching Function Args w/ shift
sub add1 {
my $number = shift;
return $number + 1;
}
add1(5);
# shift removes and returns the first
# element of an array, and the default
# array is @_
Previous slide
Next slide
Back to first slide
View graphic version