my $data is scalar context so the count of elements in the array @_ is assigned to $data.
my ($data) is list context so the first element of the array @_ is assigned to $data.
See Context.
In reply to Re: function parameter assignment question
by GrandFather
in thread function parameter assignment question
by perlfan99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |