#!/usr/bin/perl use strict; use CGI::Simple; my $q = new CGI::Simple; $| = 1; print $q->header( -type => 'text/plain', -expires => '+1m' ); ## the header is for plain text, and the data expires in 1m ## If there's no file parameter, exit with an error message unless ($q->param('file')) { print 'No File was requested'; exit; } open LOG, '<', $q->param('file') or do { # exit with error if we can't open the file print 'Unable to open file ',$q->param('file'),':',$!; exit; }; while () { s{(\r\n)|(\n)}{\r\n}g; ## replace unix with Win line-endings print $_; }