Sub-Signatures

 view release on metacpan or  search on metacpan

lib/Sub/Signatures.pm  view on Meta::CPAN

=item * Use caution when mixing functions and methods

Internally, functions and methods are handled quite differently.  If you use
this with a class, you probably do not want to use signatures with functions in
said class.  Things will usually work, but not always.  Error messages will be
misleading.

  package Foo;
  use Sub::Signatures qw/methods/;

  sub new($class) { bless {} => $class }

  sub _some_func($bar) { return scalar reverse $bar }

  sub some_method($self, $bar) { 
      $self->{bar} = _some_func($bar);
  }

  sub some_other_method($self, $bar, $baz) {
      # this fails with 
      # Could not find a method matching your signature: _some_func(SCALAR) at ...

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.892 second using v1.00-cache-2.02-grep-82fe00e-cpan-9e6bc14194b )