open(FH, '>', $filename) or die "cannot open file"; select FH; # make print() use FH by default ... close FH; # close the filehandle print() is using by default ... # try to print() to closed FH by default (no other filehandle specified # for print(), no other open filehandle has been select()-ed) print "Three Rings for the Elven-kings under the sky,\n"; # warning: "print() on closed filehandle FH at ..."