Permalink
Switch branches/tags
Commits on Apr 27, 2012
  1. Don't iterate over all keys to honor 'store' clauses

    'store' clauses in templates are relatively rare, so it is wasteful to
    iterate over all the returned members just to check that relevant key in
    the template wants to store the value in a ref.
    
    Instead, we note which keys want to 'store' while setting up the default
    values, and only iterate over them at the end of check().
    vpit committed Apr 27, 2012
  2. Inline _sanity_check_and_defaults()

    This will help further cleanups and optimizations.
    
    Note that some caller frame numbers have been decremented so that stack
    frames on errors are still correct.
    vpit committed Apr 27, 2012
Commits on Apr 25, 2012
  1. Update CHANGES and bump to 0.34

    bingos committed Apr 25, 2012
Commits on Apr 22, 2012
  1. Inline _clean_up_args()

    vpit committed Apr 22, 2012
  2. Don't unpack hashes in check() either

    Also preload the current argument in the body of the main loop.
    vpit committed Apr 22, 2012
  3. Don't unpack hash arguments in _sanity_check_and_defaults()

    Also preload the current topic template in the body of the loop.
    vpit committed Apr 22, 2012
Commits on Aug 8, 2011
Commits on Jul 25, 2011
  1. Resolve [rt.cpan.org #69626] reported by Diab Jerius

    Hi,
    
    If I set WARNINGS_FATAL, Params::Check doesn't always croak upon
    error. There are two points in the check() subroutine with unguarded
    simple returns:
    
    249
    250 ### did we get the arguments we need? ###
    251 return if !$utmpl or !$href;
    252
    
    268 ### sanity check + defaults + required keys set? ###
    269 my $defs = _sanity_check_and_defaults( $utmpl, $args, $verbose )
    270 or return;
    271
    
    Additionally, the checks at line 251 are performed before
    clear_error() is called, so last_error() will return any errors from a
    previous call, not the current one.
    
    This makes reporting an error more complicated:
    
    The checks at line 251 must be duplicated in user code because if the
    checks have failed last_error() can't be trusted (an incorrect error
    message may be reported).
    
    As not all errors are thrown if WARNINGS_FATAL=true, there's
    no point in using exceptions to clean up error code.
    
    Thanks! (and thanks for the module)
    
    Diab
    bingos committed Jul 25, 2011
Commits on Jan 7, 2011
  1. Bump version and update CHANGES

    git-svn-id: http://oss.dwim.org/params-check@2881 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    bingos committed Jan 7, 2011
  2. Fix trailing whitespace

    git-svn-id: http://oss.dwim.org/params-check@2880 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    bingos committed Jan 7, 2011
  3. Fix typos (spelling errors) in cpan/Params-Check/*.

    # New Ticket Created by  (Peter J. Acklam)
    # Please include the string:  [perl #81844]
    # in the subject line of all future correspondence about this issue.
    # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81844 >
    
    Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
    
    git-svn-id: http://oss.dwim.org/params-check@2879 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    bingos committed Jan 7, 2011
Commits on Mar 31, 2007
  1. r3900@rimmer: kane | 2007-03-31 18:23:38 +0200

     
    
    
    git-svn-id: http://oss.dwim.org/params-check@1819 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    Jos Boumans committed Mar 31, 2007
Commits on Mar 1, 2007
  1. r3851@rimmer: kane | 2007-03-01 12:10:39 +0100

     * this be 0.26
    
    
    git-svn-id: http://oss.dwim.org/params-check@1793 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    Jos Boumans committed Mar 1, 2007
  2. r3848@rimmer: kane | 2007-03-01 12:04:19 +0100

     * up version to 0.26
     * address #23824: Bug concering the loss of the last_error message 
       when checking recursively.
    
    
    git-svn-id: http://oss.dwim.org/params-check@1792 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    Jos Boumans committed Mar 1, 2007
Commits on Jan 26, 2007
  1. r3701@rimmer: kane | 2007-01-26 17:21:45 +0100

     * starting 5.9.5, all these modules are core, so they need to be installed in 'perl',
       not 'site' dirs.. fix Makefile.PL's accordingly.
    
    
    git-svn-id: http://oss.dwim.org/params-check@1721 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    Jos Boumans committed Jan 26, 2007
Commits on Nov 8, 2006
  1. * unf*ckup the repo

    git-svn-id: http://oss.dwim.org/params-check@1666 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    Jos Boumans committed Nov 8, 2006
Commits on Nov 1, 2006
  1. r2700@codebase2: kane | 2006-08-17 22:27:32 +0200

     Commit history from perforce during svk import:
     
     Change 12553 on 2006/07/05 by kane@coke
      
      	   * this is 0.25
      	   * apply patch from #20299 that implements the 
      	     $Params::Check::CALLER_DEPTH variable.
      
      Change 12438 on 2006/04/27 by kane@coke
      
      	   * add a warning (+ test for it) if the store => variable
      	   is not a reference.
      
      Change 12379 on 2006/03/02 by kane@coke
      
      	* this marks 0.24
      
      Change 11971 on 2005/02/22 by kane@coke
      
      	* add new global $WARNINGS_FATAL
      	* add tests
      
      Change 11290 on 2004/11/11 by kane@coke
      
      	* this marks 0.22
      	* Make error reporting of invalid keys contain
    		the stringified version of the disallowed value.
      	* Add tests for this
      	* Remove meta.yml from vcs
      
      Change 10912 on 2004/06/18 by kane@myriad
      
      	* this marks 0.21
      	* templates with default => '' were ending up as undef
      		* fix code
      		* add tests
      
      Change 10892 on 2004/06/17 by kane@myriad
      
      	* add some test cases
      
      Change 10887 on 2004/06/16 by kane@myriad
      
      	* move check2 to check
      	* add some more optimizations
      	* update tests to use check.pm
      
      Change 10886 on 2004/06/16 by kane@myriad
      
      	* finish tests on rewrite 
      	* few more bug fixes found by tests
      
      Change 10885 on 2004/06/16 by kane@coke
      
      	* finish first revision
      	* start rewriting tests
      
      Change 10211 on 2004/02/26 by kane@coke
      
      	   * this be 0.07
      
      Change 8172 on 2003/09/18 by kane@coke
      
      	* This marks 0.04
      	* add test for allow()
      	* update changes file
      
      Change 7643 on 2003/08/21 by kane@myriad
      
      	* split out the 'allow' functionality into a seperate sub
      	* add docs
      	* fix test
      
      Change 7373 on 2003/08/06 by kane@freggel
      
      	* add a last_error() sub that gives a stringified version of all the warnings/errors 
      	reported during a check().
      	* add tests for it
      
      Change 5840 on 2003/05/14 by kane@coke
      
      	* prepare for 0.03
      
      Change 5772 on 2003/05/12 by kane@coke
      
      	* default to verbose = 1 only if warnings are enabled
      	* add $PRESERVE_CASE that doesn't lc all keys in the template/rv
      	* add tests to match
      
      Change 5733 on 2003/05/09 by kane@coke
      
      	* add a 'store' key to the template
      	* update docs 
      	* update tests
      
      Change 5671 on 2003/05/07 by kane@freggel
      
      	* tests fixed, temporarily bundled L::M::Simple in ext/ until autrijus releases it
      	* pending doc and test patches for positional code patch by thomas
      
      Change 5640 on 2003/05/06 by kane@freggel
      
      	* first time addition of Params::Check - formerly Tools::Check
      
     
    
    
    git-svn-id: http://oss.dwim.org/params-check@1483 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    Jos Boumans committed Nov 1, 2006
Commits on Oct 18, 2006
  1. r2746@rimmer: kane | 2006-10-18 16:30:55 +0200

     * newline fix
    
    
    git-svn-id: http://oss.dwim.org/params-check@869 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    Jos Boumans committed Oct 18, 2006
Commits on Aug 17, 2006
  1. r2700@codebase2: kane | 2006-08-17 22:27:32 +0200

     Commit history from perforce during svk import:
     
     Change 12553 on 2006/07/05 by kane@coke
      
      	   * this is 0.25
      	   * apply patch from #20299 that implements the 
      	     $Params::Check::CALLER_DEPTH variable.
      
      Change 12438 on 2006/04/27 by kane@coke
      
      	   * add a warning (+ test for it) if the store => variable
      	   is not a reference.
      
      Change 12379 on 2006/03/02 by kane@coke
      
      	* this marks 0.24
      
      Change 11971 on 2005/02/22 by kane@coke
      
      	* add new global $WARNINGS_FATAL
      	* add tests
      
      Change 11290 on 2004/11/11 by kane@coke
      
      	* this marks 0.22
      	* Make error reporting of invalid keys contain
    		the stringified version of the disallowed value.
      	* Add tests for this
      	* Remove meta.yml from vcs
      
      Change 10912 on 2004/06/18 by kane@myriad
      
      	* this marks 0.21
      	* templates with default => '' were ending up as undef
      		* fix code
      		* add tests
      
      Change 10892 on 2004/06/17 by kane@myriad
      
      	* add some test cases
      
      Change 10887 on 2004/06/16 by kane@myriad
      
      	* move check2 to check
      	* add some more optimizations
      	* update tests to use check.pm
      
      Change 10886 on 2004/06/16 by kane@myriad
      
      	* finish tests on rewrite 
      	* few more bug fixes found by tests
      
      Change 10885 on 2004/06/16 by kane@coke
      
      	* finish first revision
      	* start rewriting tests
      
      Change 10211 on 2004/02/26 by kane@coke
      
      	   * this be 0.07
      
      Change 8172 on 2003/09/18 by kane@coke
      
      	* This marks 0.04
      	* add test for allow()
      	* update changes file
      
      Change 7643 on 2003/08/21 by kane@myriad
      
      	* split out the 'allow' functionality into a seperate sub
      	* add docs
      	* fix test
      
      Change 7373 on 2003/08/06 by kane@freggel
      
      	* add a last_error() sub that gives a stringified version of all the warnings/errors 
      	reported during a check().
      	* add tests for it
      
      Change 5840 on 2003/05/14 by kane@coke
      
      	* prepare for 0.03
      
      Change 5772 on 2003/05/12 by kane@coke
      
      	* default to verbose = 1 only if warnings are enabled
      	* add $PRESERVE_CASE that doesn't lc all keys in the template/rv
      	* add tests to match
      
      Change 5733 on 2003/05/09 by kane@coke
      
      	* add a 'store' key to the template
      	* update docs 
      	* update tests
      
      Change 5671 on 2003/05/07 by kane@freggel
      
      	* tests fixed, temporarily bundled L::M::Simple in ext/ until autrijus releases it
      	* pending doc and test patches for positional code patch by thomas
      
      Change 5640 on 2003/05/06 by kane@freggel
      
      	* first time addition of Params::Check - formerly Tools::Check
      
     
    
    
    git-svn-id: http://oss.dwim.org/params-check@583 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    Jos Boumans committed Aug 17, 2006
  2. r2699@codebase2: kane | 2006-08-17 22:27:30 +0200

     Commit history from perforce during svk import:
     
     Change 12630 on 2006/08/14 by kane@coke
      
      	   * change =head1 NAME Foo::Bar -- to single - to comply with strict pod rules
      
      Change 12553 on 2006/07/05 by kane@coke
      
      	   * this is 0.25
      	   * apply patch from #20299 that implements the 
      	     $Params::Check::CALLER_DEPTH variable.
      
      Change 12438 on 2006/04/27 by kane@coke
      
      	   * add a warning (+ test for it) if the store => variable
      	   is not a reference.
      
      Change 12379 on 2006/03/02 by kane@coke
      
      	* this marks 0.24
      
      Change 11972 on 2005/02/22 by kane@coke
      
      	* this marks 0.23
      
      Change 11971 on 2005/02/22 by kane@coke
      
      	* add new global $WARNINGS_FATAL
      	* add tests
      
      Change 11682 on 2004/12/19 by coral@cay
      
      	* typographical error message fix
      
      Change 11656 on 2004/12/16 by coral@cay
      
      	* clean up extra end-of-line whitespace
      
      Change 11560 on 2004/12/07 by coral@cay
      
      	* spelling fix: "it's" -> "its"
      
      Change 11326 on 2004/11/12 by kane@cay
      
      	* spelling fixes
      	* reword a bit of docs (re: "valide")
      
      Change 11290 on 2004/11/11 by kane@coke
      
      	* this marks 0.22
      	* Make error reporting of invalid keys contain
    		the stringified version of the disallowed value.
      	* Add tests for this
      	* Remove meta.yml from vcs
      
      Change 10912 on 2004/06/18 by kane@myriad
      
      	* this marks 0.21
      	* templates with default => '' were ending up as undef
      		* fix code
      		* add tests
      
      Change 10903 on 2004/06/17 by kane@myriad
      
      	* this marks 0.20
      	* update changes
      	* update manifest
      
      Change 10902 on 2004/06/17 by kane@myriad
      
      	* readd documentation
      
      Change 10900 on 2004/06/17 by kane@myriad
      
      	* remove optimizations that didn't wokr yet
      
      Change 10897 on 2004/06/17 by kane@myriad
      
      	* only entere store keys if we have something to store it in
      
      Change 10896 on 2004/06/17 by kane@myriad
      
      	* elimiate 2nd full iteration over template for store purposes
      		instead, keep a 2nd hash that lists store keys.
      
      Change 10895 on 2004/06/17 by kane@myriad
      
      	* save another deref
      
      Change 10894 on 2004/06/17 by kane@myriad
      
      	* small improvement again
      
      Change 10893 on 2004/06/17 by kane@myriad
      
      	* move lexical out of the loop, another speed up
      
      Change 10891 on 2004/06/17 by kane@myriad
      
      	* avoid useless lexical
      
      Change 10889 on 2004/06/17 by kane@myriad
      
      	* make it possible to skip template 
      	* use @_ instead of lexicals in allow, since it's hot code
      
      Change 10887 on 2004/06/16 by kane@myriad
      
      	* move check2 to check
      	* add some more optimizations
      	* update tests to use check.pm
      
      Change 10882 on 2004/06/16 by kane@myriad
      
      	* speed ups for params::check
      	* add check2, a rewrite that should make it even faster
      
      Change 10275 on 2004/03/01 by kane@myriad
      
      	* always fall back to a _safe_eq rather than saying we don't know how to do allow
      		checks -- this allows comparing of 2 objects
      
      Change 10211 on 2004/02/26 by kane@coke
      
      	   * this be 0.07
      
      Change 9989 on 2004/02/10 by kane@coke
      
      	* doc fixes
      
      Change 9988 on 2004/02/10 by kane@coke
      
      	* allow nested lists to be allow()'d
      	* deal well with 'undef'		
      
      Change 8955 on 2003/11/19 by kane@myriad
      
      	* add some more pod
      	* up version
      
      Change 8172 on 2003/09/18 by kane@coke
      
      	* This marks 0.04
      	* add test for allow()
      	* update changes file
      
      Change 7666 on 2003/08/23 by kane@myriad
      
      	* Tidy up docs, add a description to the NAME field
      
      Change 7644 on 2003/08/21 by kane@myriad
      
      	* "" is also a valid key, as is 0
      
      Change 7643 on 2003/08/21 by kane@myriad
      
      	* split out the 'allow' functionality into a seperate sub
      	* add docs
      	* fix test
      
      Change 7373 on 2003/08/06 by kane@freggel
      
      	* add a last_error() sub that gives a stringified version of all the warnings/errors 
      	reported during a check().
      	* add tests for it
      
      Change 6577 on 2003/06/16 by kane@freggel
      
      	* storing wasn't working properly if you didn't pass the key -- fixed
      
      Change 6316 on 2003/06/05 by kane@coke
      
      	* move from warn to carp to get a better caller perspective
      
      Change 5840 on 2003/05/14 by kane@coke
      
      	* prepare for 0.03
      
      Change 5772 on 2003/05/12 by kane@coke
      
      	* default to verbose = 1 only if warnings are enabled
      	* add $PRESERVE_CASE that doesn't lc all keys in the template/rv
      	* add tests to match
      
      Change 5745 on 2003/05/10 by kane@freggel
      
      	* L::M::S differs slightly from the old version, update to use compatible style
      	* this marks the release point for the modules
      
      Change 5733 on 2003/05/09 by kane@coke
      
      	* add a 'store' key to the template
      	* update docs 
      	* update tests
      
      Change 5671 on 2003/05/07 by kane@freggel
      
      	* tests fixed, temporarily bundled L::M::Simple in ext/ until autrijus releases it
      	* pending doc and test patches for positional code patch by thomas
      
      Change 5640 on 2003/05/06 by kane@freggel
      
      	* first time addition of Params::Check - formerly Tools::Check
      
     
    
    
    git-svn-id: http://oss.dwim.org/params-check@582 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    Jos Boumans committed Aug 17, 2006
  3. r2698@codebase2: kane | 2006-08-17 22:27:27 +0200

     Commit history from perforce during svk import:
     
     Change 5682 on 2003/05/07 by kane@freggel
      
      	* update the README's with the old description from Tools.pm
      	* add author/copyright notice
      
      Change 5640 on 2003/05/06 by kane@freggel
      
      	* first time addition of Params::Check - formerly Tools::Check
      
     
    
    
    git-svn-id: http://oss.dwim.org/params-check@581 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    Jos Boumans committed Aug 17, 2006
  4. r2697@codebase2: kane | 2006-08-17 22:27:24 +0200

     Commit history from perforce during svk import:
     
     Change 5640 on 2003/05/06 by kane@freggel
      
      	* first time addition of Params::Check - formerly Tools::Check
      
     
    
    
    git-svn-id: http://oss.dwim.org/params-check@580 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    Jos Boumans committed Aug 17, 2006
  5. r2696@codebase2: kane | 2006-08-17 22:27:22 +0200

     Commit history from perforce during svk import:
     
     Change 10903 on 2004/06/17 by kane@myriad
      
      	* this marks 0.20
      	* update changes
      	* update manifest
      
      Change 5840 on 2003/05/14 by kane@coke
      
      	* prepare for 0.03
      
      Change 5733 on 2003/05/09 by kane@coke
      
      	* add a 'store' key to the template
      	* update docs 
      	* update tests
      
      Change 5671 on 2003/05/07 by kane@freggel
      
      	* tests fixed, temporarily bundled L::M::Simple in ext/ until autrijus releases it
      	* pending doc and test patches for positional code patch by thomas
      
      Change 5640 on 2003/05/06 by kane@freggel
      
      	* first time addition of Params::Check - formerly Tools::Check
      
     
    
    
    git-svn-id: http://oss.dwim.org/params-check@579 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    Jos Boumans committed Aug 17, 2006
  6. r2695@codebase2: kane | 2006-08-17 22:27:19 +0200

     Commit history from perforce during svk import:
     
     Change 12553 on 2006/07/05 by kane@coke
      
      	   * this is 0.25
      	   * apply patch from #20299 that implements the 
      	     $Params::Check::CALLER_DEPTH variable.
      
      Change 12379 on 2006/03/02 by kane@coke
      
      	* this marks 0.24
      
      Change 11290 on 2004/11/11 by kane@coke
      
      	* this marks 0.22
      	* Make error reporting of invalid keys contain
    		the stringified version of the disallowed value.
      	* Add tests for this
      	* Remove meta.yml from vcs
      
      Change 10912 on 2004/06/18 by kane@myriad
      
      	* this marks 0.21
      	* templates with default => '' were ending up as undef
      		* fix code
      		* add tests
      
      Change 10903 on 2004/06/17 by kane@myriad
      
      	* this marks 0.20
      	* update changes
      	* update manifest
      
      Change 10211 on 2004/02/26 by kane@coke
      
      	   * this be 0.07
      
      Change 9990 on 2004/02/10 by kane@coke
      
      	* this be 0.05
      
      Change 8172 on 2003/09/18 by kane@coke
      
      	* This marks 0.04
      	* add test for allow()
      	* update changes file
      
      Change 5840 on 2003/05/14 by kane@coke
      
      	* prepare for 0.03
      
     
    
    
    git-svn-id: http://oss.dwim.org/params-check@578 4dccba1d-3c1b-0410-aec4-feb514a8dabc
    Jos Boumans committed Aug 17, 2006