in reply to •Re: Re^2: One liner to Check and undef hash elements (shortcircuiting)
in thread One liner to Check and undef hash elements

Yeah, I know.. you can at least drop a last in there and simplify the loop condition, if you use a while. Or how about a variant on until:
my $hash_has_undef = do { local $_; 1 until defined or not (undef, $_) = each %hash; defined; };
Traded the flag variable for a double defined test on the last value fetched from the hash.

Makeshifts last the longest.

  • Comment on Re^4: One liner to Check and undef hash elements (shortcircuiting)
  • Download Code