in reply to Regexing a hash line thing

Perhaps this:

while( <DATA> ) { my @m= m{ ^\s* ( \w+ | '(?:\\.|[^\\']+)*' | "(?:\\.|[^\\"]+)*" ) \s* => \s* ( \w+ | '(?:\\.|[^\\']+)*' | "(?:\\.|[^\\"]+)*" ) \s*,?\s*$ }x; print "(", join("|",@m), $/; } __END__ key => 44, "key" => "fun. \"yes\" 'fun'", 'key' => 'yahoo\' "fun"'
will work for you.

        - tye => "Tye"