##
sub routine
{
my %override = %{$_[$[]}; # reference to a hash.
my $var = $_[1+$[]; # scalar
my %defaults = ref( $_[2+$[] ) ? %{$_[2+$[]} : {}; # optional hash ref.
#blah...
####
prompt> perl -we "print ref( undef() ) ? 'y' : 'n'"
n