in reply to Expect Trouble

tc1364
I assume you changed the 'command prompt' to be 'command prompt' not ">" or even "#"? Are you sure the error messages are being matched at all? Have you tried adding prints inside the subroutines to validate which subroutine is fired off (indeed if any are fired off). Also, use that print to validate the $err_flg value.
What do you mean by 'not to try and match anything because the command prompt is always returned'. Could you help us out with a more detailed version of what you want to happen and what you are seeing happen?

s&&VALKYRIE &&& print $_^q|!4 =+;' *|