in reply to Break perl foreach loop

How about printing $x before testing to see if it matches "Patient"? Is that condition simply not being met?

Also, try to minimize slashes in your REs: Choose a different delimiter; you don't need to escape double-quotes; and character sets can help, too (consider s/["()]//g; versus s/\"|\(|\)//g;)

And consider combining multiple prints with commas or dots:

print "<DATE>", $x, "</DATE>\n"; # or print "<DATE>" . $x . "</DATE>\n";

Replies are listed 'Best First'.
Re^2: Break perl foreach loop
by pvecchio (Initiate) on Mar 03, 2009 at 17:30 UTC
    Thank you for the help.
    Yes, the Last WID is being hit. I did do a print $x if "Patient" is matched. So I'm confident that the condition is met. I only have Notepad ++ as an editor so my indentation is ugly. I like the character sets in the REs. I will use that (and the dots too).