in reply to Match and not match
You said what you want, just state it in perl:
if( $res =~ /58=Invalid/ and not $res =~ /59=3/ ) { grobble_error( $res ); } else { print "58=Invalid and 59=3\n"; } [download]