print $fh "foo\n" or die "Error writing: $!"; #### perl -le "print BLAH 'foo' or warn $!; print 'foo'; print $!";