in reply to Re^2: regex match multiple line
in thread regex match multiple line (updated question)

In case you haven't figured it out yet, you're really close. In your while loop, change this:
if ( $key =~ m/^$error.*/ ) {
to this:
if ( $error =~ m/^$key:/ ) {
Then again, maybe I totally misunderstood your question.

Replies are listed 'Best First'.
Re^4: regex match multiple line
by natxo (Scribe) on Nov 27, 2014 at 07:52 UTC
    yes, that was the mistake :(

    Thanks!