in reply to Constructing a hash - why isn't my regex matching anything
The solution is to either use $1 for assignment if( // ){ $key = $1; ...) or use list context ( my ( $foo ) = //;)
Tutorials: Context in Perl: Context tutorial
FYI, when posting