in reply to When testing for certain hash positions as non-zero, why werent the test positions set to empty string?

I think some behavior in Perl hash usage has changed. It used to be that $hash{test_elem} would set that hash key to a value of '' (empty string).

How would you know it no longer does that? Your code doesn't demonstrate this. (I see the Dumper now)

That said, it's true that Perl doesn't do that, and I doubt it ever did. Here's how Perl behaves:

In no case does Perl assign an empty string to a scalar. Undef does resemble the empty string, but not in Dumper's output.

  • Comment on Re: When testing for certain hash positions as non-zero, why werent the test positions set to empty string?
  • Select or Download Code