Help for this page

Select Code to Download


  1. or download 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.
    
  2. or download this
    #!/usr/bin/perl
    
    ...
    }
    
    func1("test");
    
  3. or download this
    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