Well I am looking at making (yet another) module for adding signatures to Perl subroutines.

I know that there are a lot of solutions to this problem already, but of course none of them works exactly like I want them to. The problem with them is generaly that you have to choose if you want positional argument passing or named argument passing, but a single subroutine cannot have both. I want it to be possible to pass the arguments either as positional arguments or as named arguments. The caller should decide what they want to use.

To make that possible I need some way to distinguish a hash reference that contains named arguments and one that is just a normal argument. By associating an attribute with a hash refernence that might be possible.

And yes I know I will probably not be able to make a module that is better than what already exists on CPAN, but you can't blame a guy for trying :) And I am learning a lot of Perl along the way.


In reply to Re^2: Adding attributes to values? by oyse
in thread Adding attributes to values? by oyse

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.