I'm parsing an file, and parts of it is a records thing, the format is like:
CategoryA--
5: UserA
6: UserB
7: UserC
CategoryB--
4: UserA
5: UserB
I want to move it to a hash that looks like:
{ UserA => { CategoryA => 5, CategoryB => 4, },
UserB => { CategoryA => 6, CategoryB => 5, },
UserC => { CategoryA => 7, },
}
How do I do regex on this?
Edit: It does not have to be purely only regex - just in perl and loops would be good too.