As jryan points out, perl closes all open filehandles at the end of the script.
If you want to do some elaborate handling in case of run time errors ( such as die and croak ) you can either:
# use eval eval{ # your code here }; if( $@ ) { # error handling code here } # ... or use $SIG{ __DIE__ } $SIG{ __DIE__ } = sub{ # error handling code here } # your code here
Since $SIG{ __DIE__ } is sort of handled like any other signals, you can specify the value of $SIG{ __DIE__ } just like you specify other signal handlers
In reply to Re: Cleaning up a script
by lestrrat
in thread Cleaning up a script
by Mac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |