http://www.perlmonks.org?node_id=1004600


in reply to Any difference between use and require regarding honoring prototype defined for sub?

Yes, there is a difference, use use and not require

should be documented in perlsub

if you use require, you'll need to use a forward declaration

$ perl -le "sub f($$@@){warn qq{@_}} f(@ARGV,@ARGV,@ARGV); " 1 2 3 4 5 5 5 1 2 3 4 5 at -e line 1. ## simulate "require" $ perl -le " eval q{sub f($$@@){warn qq{@_}}}; f(@ARGV,@ARGV,@ARGV); " + 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 at (eval 1) line 1. ## forward/early/prototype declaration $ perl -le " sub f($$@@); eval q{sub f($$@@){warn qq{@_}}}; f(@ARGV,@A +RGV,@ARGV); " 1 2 3 4 5 5 5 1 2 3 4 5 at (eval 1) line 1.