#! /usr/pkg//bin/perl

# ASCII-to-HTML converter

# reads in an ASCII file, outputting the original lines intact 
#    but replacing the empty lines by the HTML new-paragraph symbol <P>

   #  open the file specified in the first command-line argument; if this
   #     fails, then print the error message and exit
   open(IN,@ARGV[0]) || die "can't open $ARGV[0]\n";

   #  while there are still lines left to read from the file do
   while  (<IN>)  {
      # $_ is the line read from IN
      $save = $_;
      # remove the last character (newline character)
      chop;
      if ($_)  
         { print $save; }
      else
         { print "<P>\n"; }
   }


