Help for this page
foo(1,2,3,4); sub foo { my (@args) = @_; # now @args holds a _copy_ of all the arguments }
sub foo { my $first = shift; # get the first argument and remove it from @_; my $last = pop; # get the last argument and remove it from @_; }
my $i = 1; inc($i); sub inc { $i++; #note: $i is not declared and read from @_ }
my $i = 1; inc($i); ... my $i = shift; # declare and read $i from @_ $i++; }
www.com | www.net | www.org
No recent polls found