1 2 3 4 5 6 7 8 9 10 11
#!/usr/bin/perl use strict; use warnings; my $time = time; sub f { localtime $time } my %h = ( scalar f() => 1 ); print grep { defined } @h{+f} ? "not this" : "this prints", "\n"; print grep { defined } $h{+f} ? "this prints" : "not this", "\n";
1 2 3
Scalar value @h{+f} better written as $h{+f} at t.pl line 10. this prints this prints