In your second example, $1 and $2 are not set at the time you're creating the %translation hash. Those are only set after a successful capturing match.
Rather than help you with the regex, I think I'd rather pont you at Config::Inifiles, which may do most of the task for you.
In reply to Re: using $1 in a hash?
by VSarkiss
in thread using $1 in a hash?
by mhyper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |