in reply to How to end a Perl script

1. 1; # A simple number 1
This notation is commonly used when writing modules. In order to successfully load a module at compile time, that module must return a true value. Having a 1(a valid true value) as the last command in the module ensures that at true value will be returned.

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();




Amel