#!/usr/bin/perl -w BEGIN {#outputs al errors to $logfile my $logfile = "logfile.log"; use CGI::Carp qw(carpout); open(LOG, ">$logfile") or die "Unable to write to $logfile: $!"; carpout(*LOG); }#