NAME

Sub::Apply - apply arguments to proc.

SYNOPSIS

use Sub::Apply qw(apply apply_if);

{
  my $procname = 'sum';
  my $sum = apply( $procname, 1, 2, 3);
}

{
  my $procname = 'sum';
  my $sum = apply_if( $procname, 1, 2, 3); 
  # not die if $procname does not exist.
}

DESCRIPTION

Sub::Apply provides function apply. This function apply arguments to proc.

EXPORT_OK

apply, apply_if

METHOD

apply($procname, @args)

Apply @args to $procname. If you want to call function that not in current package, you do like below.

apply('Foo::sum', 1, 2)

apply_if($procname, @args)

Same as apply. but apply_if does not die unless $procname does not exist.

WARNING

apply and apply_if cannot call CORE functions.

AUTHOR

Yoshihiro Sasaki, <ysasaki at cpan.org<gt>

COPYRIGHT AND LICENSE

Copyright (C) 2011 by Yoshihiro Sasaki

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.