use strict; use warnings; my (%hash, $value); print "Without\n"; $hash{key} = $value; if ($hash{key} == 42) { print "taking appropriate action\n" } print "With\n"; $hash{key} = $value || 0; if ($hash{key} == 42) { print "taking appropriate action\n" }