Im passing array by reference to a subroutine:
my @template_ops;
handle_templates_with_post_mod(\@template_ops);
sub handle_templates_with_post_mod
{
my @my_template_ops = @{$_[0]};
unshift (@my_template_ops), 'O';
}
but after calling the subroutine the array still empty, I have tried:
sub handle_templates_with_post_mod
{
my $my_template_ops = shift;
unshift (@$my_template_ops), 'O';
}
but I get this error: Can't use string ("...") as an ARRAY ref while "strict refs"