In Perl, arguments are passed in an array. If you pass two arguments, the array will have a length of 2. If you access anything beyond it will yield an undefined value (Perl has a real OOB value 'undef'). So if you define a subroutine that expects three parameters, and you call it two, the third will be undef.
sub foo {
my ( $a, $b, $c ) = @_;
unless ( defined($c) ) {
print("it was undefined\n");
}
}
foo(1,2);
Javascript:
function foo(a,b,c) {
if ( c === undefined )
console.log("it was undefined")
}
foo(1,2)
This prints "it was undefined".