in reply to substr complexities

My crystal ball is playing up as well, but consider this extract from perldoc perlre (my emphasis):

The numbered variables ($1, $2, $3, etc.) ... are all dynamically scoped until the end of the enclosing block or until the next successful match, whichever comes first.

So it might be that your $1 is getting clobbered by the success of the following regexes. Try changing the order of your if() to the following (some punctuation removed):

if ( /t_9840_acs_0/ && ! /\*Orig/ && /\((E\d+)/ ) { print "$1\n"; }

dave