X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=README;h=915c7892431054b6ac34706ce98f6e75e0dd6add;hb=29d3a214c70390edd665985eddfb42ff7e29a02a;hp=20b9d5904e2d17b8ef5ae8a766d2e0f430cc3a30;hpb=4b145ee918e94698fe49c6e9240d50cfb2a36c75;p=perl%2Fmodules%2FSub-Prototype-Util.git diff --git a/README b/README index 20b9d59..915c789 100644 --- a/README +++ b/README @@ -1,8 +1,8 @@ NAME - Sub::Prototype::Util - Prototypes-related utility routines. + Sub::Prototype::Util - Prototype-related utility routines. VERSION - Version 0.01 + Version 0.05 SYNOPSIS use Sub::Prototype::Util qw/flatten recall/; @@ -16,7 +16,7 @@ SYNOPSIS DESCRIPTION Prototypes are evil, but sometimes you just have to bear with them, especially when messing with core functions. This module provides - several utilities aimed at faciliting "overloading" of prototyped + several utilities aimed at facilitating "overloading" of prototyped functions. They all handle 5.10's "_" prototype. @@ -40,12 +40,24 @@ FUNCTIONS 3". This is especially needed for core functions because you can't "goto" into them. + You can also force the use of a specific prototype. In this case, $name + must be a hash reference that holds exactly one key/value pair, the key + being the function name and the value the prototpye that should be used + to call it. + + recall { 'CORE::push' => '\@$' }, $a, 1, 2, 3; # will only push 1 + + This allows you to recall into "CORE::grep" and "CORE::map" by using the + "\&@" prototype : + + sub mygrep (&@) { recall { 'CORE::grep' => '\&@' }, @_ } # the prototypes are intentionally different + EXPORT The functions "flatten" and "recall" are only exported on request, - either by providing their name or by the ':consts' and ':all' tags. + either by providing their name or by the ':funcs' and ':all' tags. DEPENDENCIES - Carp (core module since perl 5), Scalar::Util (since 5.7.3). + Carp, Exporter (core modules since perl 5), Scalar::Util (since 5.7.3). AUTHOR Vincent Pit, "", .