BEGIN { use CGI::Carp qw(carpout); if ($RealBin =~ m!^(/home/xxx/yyy/(test|uk)/www)!) { $safepath = "$1/../lib"; } else { die "Illegal use of software - visit www.way-finder.uk to use this site"; } open LOG, '>>', '/home/xxx/yyy/test_error_log.log' or die "Unable to open error log"; carpout(\*LOG); }