#!/usr/local/bin/perl
#Read from a file delimmited by "_*_" instead of "\n"

print "Content-type: text/html\n\n";

print <<HEAD;
<html>
<head>
<title>Displaying a file with different record delimiters"</title>
</head>
<body>
HEAD
    ;
print_file('\n');
print_file('_*_');
print <<TAIL;
</body>
</html>
TAIL
    ;

sub print_file
{
    my($delim) = @_;
    open file, "<show_delim.file";

    $/=$delim;

    print "<h3>Displaying file with ",$delim," as the record delimiter<h3>";
    print "<table border=0 bgcolor=#ffffff><tr><td>\n";
    while (<file>)
    {
	print "$_<br>\n";
    }
    print "</table>";

    close file;
}
