in reply to Alternation in pattern matches

Your example isn't 100% clear about which of the test cases have valid data and which don't. One way to make things clearer is to allow for (and ignore) comment lines:
while ( <DATA> ) { next if /^(?:#.*|\s*)$/; ... } __DATA__ # These should pass TAG:"test of data" ... # These should fail TAG: test ...
That saves us from having to guess, and removes the risk of our guessing wrong.

Replies are listed 'Best First'.
Re: Re: Alternation in pattern matches
by guha (Priest) on Feb 19, 2004 at 09:12 UTC

    Yes you are correct, it's not 100% clear, but fairly close I would say given the sentence.

    The program below already does the right thing, but I have ....

    During the composal of the node, the idea of including test ala Test::More occurred to me, but laziness got the better of me.

    Anyway your idea with comments in the DATA section is nice and I will try to remember that.

    Thanks for your input dws, as always mature and experienced in a particular way