Further to davorg's explanation, my usual idiom for getting the desired result is to move the default into the dereference:
my @index = @{ $args{Index} || [] };
This sidesteps the problem of @array || something forcing the array into scalar context, and also permits an undefined value.
Hugo
In reply to Re: Setting defaults in subroutines
by hv
in thread Setting defaults in subroutines
by rbi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |