Dragonchild,
I've been tinkering with it for a while, but don't seem to be having much luck with positional arguments as opposed to named ones. Named parameters seem to be working fine, I just don't seem to do anything, but check for existence of positional arguments.
Just prior to the 'Dependancies' section on the documentation of the module it says....

or this for positional parameters: validate_pos( @_, { type => SCALAR }, { type => ARRAYREF, optional => + 1 } ); By default, parameters are assumed to be mandatory unless specified as + optional.
However, if I enter something like this...
#!/usr/bin/perl #use strict; use warnings; use Params::Validate; sub func1 { validate_pos( @_, { type => SCALAR} ); print "hi fluffy\n"; } func1("test");
I get the following...
Argument "SCALAR" isn't numeric in subroutine entry at ./a.pl line 8. Parameter #1 ("test") to main::func1 was a 'scalar', which is not one +of the allowed types: at ./a.pl line 8 main::func1(3) called at ./a.pl line 13
Any ideas why this is so? Ideas....?

Regards Paul

In reply to Re^2: Testing Edges by thekestrel
in thread Testing Edges by thekestrel

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.