in reply to Re: Testing Edges
in thread Testing Edges
However, if I enter something like this...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.
I get the following...#!/usr/bin/perl #use strict; use warnings; use Params::Validate; sub func1 { validate_pos( @_, { type => SCALAR} ); print "hi fluffy\n"; } func1("test");
Any ideas why this is so? Ideas....?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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Testing Edges
by cberg (Scribe) on Mar 30, 2005 at 09:04 UTC |