perl combine if

Hi Evereyone,

%q = ();
$q{"a"} = 0;
$q{"b"} = 0;
$q{"c"} = 0;

if ($q{"a"} !=0 || $q{"b"} !=0 || $q{"c"} !=0) {
print "non-zero"
}

if any simple way to do that? assume you have not only a, b, c inside %q, but a, b, c, d, e, ... ...

Thanks

One approch.

print "Non-zero"  if  int(join "", values(%q)); 

Thanks, it works :slight_smile: