Anonymous Monk,
Or perhaps not. The question doesn't go into specifics of the rest of the code so your solution
could be a problem for the following reasons:
- /\s*-\s*/ will match a single dash anywhere it appears as * means 0 or more'
- shift @$nar is destructive
- push @{ $hash{ $key1 }{ $key2 } }, $nar; will push a reference to the original not a copy so there could be spooky action at a distance depending on the rest of the code