in reply to why doesn't this flip-flop work?

Your first code is ($line =~ /abc/) .. /xyz/. You mean to write ($line =~ /abc/) .. ($line =~ /xyz/). Case closed.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart