I have an issue passing an array and a variable to a function. For example, I have the following.
my @the_array = ("hello", "hey");
CallFunction(@the_array, "random")
sub CallFunction{
my (@array_ref, $ran_variable) = @_;
foreach $element (@array_ref){
print $element ."\n";
}
}
I would want the following output
hello
hey
But I get the other variable in the output, and I don't know why.
hello
hey
random
array_refis an array, not an array reference.