home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / LANGUAGE / ADA / LOVELACE / rmhtml < prev    next >
Text File  |  1996-10-01  |  408b  |  18 lines

  1. #!/usr/local/bin/perl -w
  2.  
  3. # rmhtml - remove HTML markings.
  4. # This filter copies standard input to standard output,
  5. # removing HTML markings (anything between <> and between & and ;).
  6.  
  7. $in_pre_section = 0;
  8.  
  9. while (<>) {
  10.  if    (m/^ *<pre> *$/i) { $in_pre_section = 1; }
  11.  elsif (m/^ *<\/pre> *$/i) { $in_pre_section = 0; }
  12.  elsif (not $in_pre_section) {
  13.    s/<[^>]*>//g;
  14.    s/&[a-z][a-z]*;/ /g;
  15.    print;
  16.  }
  17. }
  18.