I can't explain why it's not catching the -k parameter. I tried it with similar result. There is one interesting thing I discovered when I dumped the object through Data::Dumper though: The paramaters '-k' and 'foo' are enumerated in @{$args->{_internal}{unused}}. So we know they were in @ARGV to begin with, and that Getopt::Declare found them, but the module doesn't seem to be using them.

I like what Damian Conway says in the docs under the BUGS section: "If nothing else, it shouldn't take 1500 lines to explain a package that was designed for intuitive ease of use!"


Dave


In reply to Re: Getopt::Declare not working by davido
in thread Getopt::Declare not working by cprice

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.