It's just very non-obvious what the code does when you're skimming it.
Especially in a dynamic language like Perl, you wouldn't know that you're passing down an integer instead of a function until the code blows up in a completely unrelated function.
Then use one of the type systems for Perl.
https://metacpan.org/pod/Type::Tiny