use strict; use warnings; $|=1; sub empty_list { @{ [] } } sub use_hash { my (%h) = @_; print(join(',',keys %h),"\n"); } use_hash(foo1 => undef, bar1 => 5); print "not defined\n" unless defined ((empty_list)[0]); use_hash(foo2 => (empty_list)[0], bar2 => 5);