in reply to Re: setting values in anonymous hash
in thread setting values in anonymous hash
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:
This is perl, v5.6.0, BTW.#!/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
|
|---|