>cat print-and-exit.pl #!/usr/bin/perl use strict; use warnings; close STDOUT if @ARGV; 1 and print "foo" and exit 0; die "Ooops, still here"; >perl print-and-exit.pl foo >perl print-and-exit.pl kaboom print() on closed filehandle STDOUT at print-and-exit.pl line 8. Ooops, still here at print-and-exit.pl line 9. >