From: Lukas Mai Date: Sun, 21 Oct 2012 17:29:22 +0000 (+0200) Subject: minor documentation changes X-Git-Tag: v0.10~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8dbfd12d549a943709fdd9a36a9b663455db0ddf;p=p5sagit%2FFunction-Parameters.git minor documentation changes --- diff --git a/lib/Function/Parameters.pm b/lib/Function/Parameters.pm index 3c15410..f601efd 100644 --- a/lib/Function/Parameters.pm +++ b/lib/Function/Parameters.pm @@ -207,6 +207,22 @@ Function::Parameters - subroutine definitions with parameter lists =pod + use Function::Parameters qw(:strict); + + fun greet($x) { + print "Hello, $x\n"; + } + + greet "foo", "bar"; + # Dies at runtime with "Too many arguments for fun greet" + + greet; + # Dies at runtime with "Not enough arguments for fun greet" + +=cut + +=pod + # use different keywords use Function::Parameters { proc => 'function', @@ -223,11 +239,6 @@ Function::Parameters - subroutine definitions with parameter lists This module lets you use parameter lists in your subroutines. Thanks to L it works without source filters. -WARNING: This is my first attempt at writing L and I have -almost no experience with perl's internals. So while this module might -appear to work, it could also conceivably make your programs segfault. -Consider this module alpha quality. - =head2 Basic stuff To use this new functionality, you have to use C instead of C - @@ -335,7 +346,7 @@ instead of a comma and will by initialized by shifting the first element off C<@_>. You can combine C and C, in which case the variable named in -C serves as a default shift target for functions that don't use an +C serves as a default shift target for functions that don't specify an explicit invocant. =item C, C