in reply to Fighting sub foo($;$$)

I really doubt this prototype ($;$$) ever served a meaningful purpose...

But for the general case, you can always write a wrapper which calls the original

use v5.12.0; use warnings; package Somename; use Data::Dumper; foo(1,2,3,4,5); sub foo($;$$) { my $one = shift; my $two = shift; my $three = shift; my $four = shift; my $five = shift; print Dumper [$four,$five]; } package Othername; # use Somename; sub foo { &Somename::foo } foo(1..5);

Somename::foo() called too early to check prototype at d:/Perl/pm/foo_ +prototype.pl line 8. $VAR1 = [ 4, 5 ]; $VAR1 = [ 4, 5 ]; Compilation finished at Sat Apr 15 00:12:57

Explanation for &Somename::foo

NB: you can also define an Somename::import sub which automatically exports the foo you want into the callers namespace, whenever use Somename; is compiled.

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery