Normally, as
MidLifeXis states,
@_ is the argument list for a
sub and
@ARGV is the argument list for a script, altho' you could, if you were sufficiently perverse, do this (without affecting
@ARGV in the calling context)...
sub foo {
local @ARGV = @_;
.
.
.
}
Note, also, that the context of the
my $argument_size = scalar(@ARGV); statement is unclear (the closing brace for either sub doesn't appear to be present), but
sub verify_function_params
{
my $num = $_[0];
my $function_name = $_[1];
my $input = $_[2];
my $type = $_[3];
my $argument_size = scalar(@_);
print "argument_size is $argument_size\n";
.
.
may well produce the results you (seem to have) expected.
Now, understanding the above, you will probably be able to see why...
sub verify_function_params
{
my $num = $_[0];
my $function_name = $_[1];
my $input = $_[2];
my $type = $_[3];
.
.
is usually written as...
sub verify_function_params
{
my ($num, $function_name, $input, $type) = @_;
.
.
A user level that continues to overstate my experience :-))