#!/usr/bin/perl use strict; open(STDERR,">>error.log") || die "Couldn't redirect STDERR: $!\n"; print STDERR "This goes to the file.\n"; warn "As does this."; die "And this does, too!\n"; close STDERR;