# https://perlmonks.org/?node_id=11119273 use strict; use warnings; use feature qw(signatures); no warnings qw(experimental::signatures); use B::Deparse; use Test::More; sub foo ($this, $that='bar') { return scalar @_; } is( foo(1), 1, "one arg" ); is( foo(1,2), 2, "two args" ); done_testing(); warn "Show implementation:\n", B::Deparse->new()->coderef2text(\&foo);