By your description, you want a hash of arrays. You can decode your data lines with a single regex like so,
The messy-looking array argument of push makes the value an array reference and avoids throwing away previous values. That way your data is permitted to continue a key later.my %data; while (<INPUT>) { if (/^-- (\w+):(.*)/) { push @{$data{$1}}, split " ", $2; } }
After Compline,
Zaxo
In reply to Re: array issue
by Zaxo
in thread array issue
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |