in reply to function parameter assignment question
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.