If you like, you can use the widely-loathed perl prototypes to get @array as a reference. You're already using them incorrectly in sub print_filename () {...}. sub print_filename (\@;@) { Now you have a syntax problem with the $object hashref, since you initialize it as a hash. Let's fix that,
Don't call this before the sub's definition has been seen, or the prototype won't be effective. Use warnings.pm to tell you if you've erred in that.my %object; @object{qw/FILE PARAMETER_ONE PARAMETER_TWO/} = @{shift()}; # other params remain on @_ ... }
After Compline,
Zaxo
In reply to Re: Passing Array to Package Subroutine With Hash Paramter List
by Zaxo
in thread Passing Array to Package Subroutine With Hash Paramter List
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |