> Now I would like to remove the _main > part of the hash keys, so I would get...
No, there is no way to change the name. The only way is to delete the key and create another one like this: $errs->{ err_notfound } = $errs->{ err_main_notfound }; delete $errs->{ err_main_notfound }; If you needed this to be really efficient you could write some XS code to make it a bit faster... but that is probably more work than you wanted to do. There might be a module to do this, but none that I am aware of. Rob -----Original Message----- From: Gerard ter Haar [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 6:53 PM To: [EMAIL PROTECTED] Subject: Rename hash keys Hi! I have a hash related question. Thanks in advance for your assistance! I have quite a large number of values in a hash: $errs->{ err_main_notfound } = "file not found. check config."; $errs->{ err_main_perms } = "no permissions, check docs".; $errs->{ err_main_unknown } = "unknown error occured."; Now I would like to remove the _main part of the hash keys, so I would get: $errs->{ err_notfound } = "file not found. check config."; $errs->{ err_perms } = "no permissions, check docs".; $errs->{ err_unknown } = "unknown error occured."; How can I accomplish this using some perl statements? Thanks and kind regards, gerard _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs