Can you reduce your problem to a complete module that is reduced to a short self-contained example that reproduces the problem?

Note that it is really weird to declare your subroutines with a prototype indicating no parameters and then to call the subroutines with actual parameters.

If you are really, really intent on moving to the new (but still experimental) function parameters as in your second example, you will have to modify all your source code to the second style. With Filter::signatures, you can then use the new style in almost all versions of Perl. You have to tell Perl that you want to use experimental features:

use feature 'signatures; sub example( $foo, $bar='baz' ) { ... }

But personally, I would recommend against making such a sweeping change right during the move between Perl versions.

Your simplified third style is what I would expect you to start out with, but as your code is in the first style, changing to the third style is inconvenient at this time too.

For me, your first example compiles without problems, so can you show us a stand-alone version that fails perl -wc so we can reproduce your situation?


In reply to Re: function prototyping & perl 5.8.20 by Corion
in thread function prototyping & perl 5.8.20 by topherv

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.