I posted this on Stack Overflow to an old question, but it didn't get many votes. So either it's a bad idea or the question was too old. Anyway, I post it here because I like this trick. Clearly, you should dump the structure and be sure that your replacement won't mess something else up. With power comes responsibility...use YAML::XS; my $yaml = Dump $hash; $yaml =~ s/SOMEKEY/SomeKey/; $hash = Load $yaml;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using serialized data structure to change hash key
by Athanasius (Archbishop) on Mar 18, 2015 at 14:32 UTC | |
by docdurdee (Scribe) on Mar 18, 2015 at 16:55 UTC | |
|
Re: Using serialized data structure to change hash key
by Arunbear (Prior) on Mar 18, 2015 at 16:03 UTC | |
|
Re: Using serialized data structure to change hash key
by vkon (Curate) on Apr 08, 2015 at 15:00 UTC |