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,

my %object; @object{qw/FILE PARAMETER_ONE PARAMETER_TWO/} = @{shift()}; # other params remain on @_ ... }
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.

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.