in reply to Re: setting values in anonymous hash
in thread setting values in anonymous hash

Well, between your snippet and merlyn's, and a CB comment by tye, I've come to a much greater understanding of what's going on. I think :)

If I'm understanding properly, you could do anything to the keys in this setting, because they're just strings and you can't get references to them to allow their modification, which is how the values get modified.

That's what my test code suggests, anyway:

#!/usr/local/bin/perl -w use strict; my $ref={ a => 'aa', b => 'bb'}; print "The hash, before:$/"; print %$ref; print qq($/The hash "during":$/); for (%$ref) { /[A-Z]/ or $_ = 'x'; print; } print "$/The hash, after:$/"; print %$ref; print $/; __END__ The hash, before: aaabbb The hash "during": xxxx The hash, after: axbx
This is perl, v5.6.0, BTW.