in reply to Printing file to browser

open (FILE, 'htmlcal.txt') or die $!,"\n"; print "Content-Type: text/html\n\n"; print "What the f***?"; while ($line = <FILE>) { print $line; } close FILE;
will be better...

-- tune

Replies are listed 'Best First'.
Re: Re: Printing file to browser
by isotope (Deacon) on Apr 03, 2001 at 20:18 UTC
    Or to be even cleaner (and faster):
    open(FILE, 'htmlcal.txt') or die $!,"\n"; print "Content-type: text/html\n\n"; print "What the f***?"; for(<FILE>) { print; } close(FILE);

    --isotope
    http://www.skylab.org/~isotope/