in reply to How to end a Perl script
2. exit; # The exit command
I use exit mostly during testing and development. Otherwise I'd rather use another way to bail out of my script if processing is finished. Using exit could be better for all I know, since an exit is sure to do just that.
3. goto BOTTOM; # goto a label at the end of the script
From what I understand goto's can create instability in the scripts. I don't think I've ever seen them used in anything outside of obfu.
4. &footer; # Nothing, just the end of the script
This is the one I most often use, unless I'm working with objects in which case I call the appropriate destructors before letting the program end.
Ex.
$sth->finish(); $dbh->disconnect();
|
|---|