# Minimum number of arguments that must be specified sub get_min_require_params { my ($sub) = @_; my $required_params = 0; my $prototype = prototype($sub); return 0 if !defined($prototype); for ($prototype) { if (/ \G (?: \$ | \* | \\(?: \[ [^\]] \] | [^\[] ) | \& ) /xsgc) { ++$required_params; next; } if (/ \G (?: \_ # Can only be followed by ";" | \@ | \% | \; | \z /xsgc) { last; } die("Unrecognized prototype\n"); } }