I'm trying to pass a couple of vars and an array to a perl module, but I can't seem to get the syntax correct. The module has the following code
and my code to call it
I keep getting an error saying that I'm missing a '$' from the foreach line. I'm sure this is something simple, but it's winding me up. Can anyone help?
Thanks
Code:
my ($new_name) = $_[0];
my ($new_desc) = $_[1];
my (@new_time) = $_[2];
print FILES "$new_name\n";
print FILES "$new_desc\n";
foreach my($tempTime) (@{$new_time})
{
print FILES "$tempTime\n";
}
Code:
update_time_log($name, $desc, \@time);
Thanks