fork download
  1. use strict;
  2. use warnings;
  3.  
  4. sub get_undef {
  5. my $undef = undef;
  6. # force scalar context
  7. return $undef;
  8. }
  9.  
  10. my %hash = (
  11. &get_undef => 'sad but true',
  12. 'true' => '0 but true',
  13. );
  14.  
  15. use Data::Dumper;
  16. print 'Results ' . Dumper(\%hash);
Success #stdin #stdout 0.02s 5104KB
stdin
Standard input is empty
stdout
Results $VAR1 = {
          '' => 'sad but true',
          'true' => '0 but true'
        };