##
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);
sub inc {
my $i = shift; # declare and read $i from @_
$i++;
}