You did not describe the *general* syntax of your file (for example, how keys can look like, and how spacing and lineout can vary), but from your posting, your code looks already very close to Perl. One possibility might be to transform the file into *real* Perl code (putting a comma between the hash elements, and placing a pair of curly brackets around the whole text) and then using do to evaluate the file.
In reply to Re: Initialize an hash with string
by rovf
in thread Initialize an hash with string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |