#!/afs/athena/contrib/perl5/perl
#
# Checks my solution for Perl Puzzle #4 from Perl Institute (wits@perl.org)

sub tryit ($) {
  local($_) = @_;
  print "<<< in\n$_";

  s@((?:\G|</?[a-z]|<![-a-z])(?:[^>"'\r\n]|"[^"]*"|'[^']*')*)[\r\n]+@$1 @gi;
  #s@((?:\G|</?[a-z]|<\![-a-z])[^>\r\n]*)[\r\n]+@$1 @gi;

  print ">>> out\n$_---\n";
}

tryit <<End1
This is a
line break.
This is <A
line break> in a tag.
This is <TWO
line
breaks> in a tag.
This is <A
TAG CONTAINING=">"
>
This is < not
a
tag>.
The <final
test>.
End1
