From: Florian Ragwitz Date: Sun, 28 Feb 2010 21:59:41 +0000 (+0100) Subject: Allow the name of the keyword to be changed. X-Git-Tag: v0.04~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b4fcf7d0d142ac56f81c83eca891a5ca2684de18;p=p5sagit%2FFunction-Parameters.git Allow the name of the keyword to be changed. --- diff --git a/lib/Function/Parameters.pm b/lib/Function/Parameters.pm index 6d5a148..78eb696 100644 --- a/lib/Function/Parameters.pm +++ b/lib/Function/Parameters.pm @@ -29,16 +29,17 @@ sub _fun ($) { $_[0] } sub import { my $class = shift; + my $keyword = shift; my $caller = guess_caller; #warn "caller = $caller"; Devel::Declare->setup_for( $caller, - { fun => { const => \&parser } } + { $keyword => { const => \&parser } } ); no strict 'refs'; - *{$caller . '::fun'} = \&_fun; + *{$caller . '::' . $keyword} = \&_fun; } sub report_pos {