Presuming your question is the implied "Why am I getting this errror?" . . .
When you call check_required_items( 'foo', @bar ) the array @bar is expanded out into the contained items. The sub however expects it to be a reference to an array and it's telling you it can't use the string "red_shirt" as a reference to the array. You want to use a backslash in front of the array name to pass a reference to it: check_required_items( 'gilligan', \@gilligan ). See perlreftut for more details.
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: Using Dereferencing
by Fletch
in thread Using Dereferencing
by catfish1116
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |