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