my $hash_ref = function($param); if ( defined $hash_ref and %$hash_ref) { ... }