#!/usr/local/bin/perl use strict; use warnings; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); print header('text/xml'); my $file = "/some/file.xml"; open(XMLFILE, $file) or die "Failed to open $file, $!"; while (){ print; }