#!/usr/bin/env perl use strict; use warnings; my $c = { }; if ($c) { warn "ng"; } if (%$c) { warn "ok"; } if (keys %{$c||{}}) { warn "!"; } 1;