in reply to require 'package'
Things like use and require can be reduced to do with additional logic. All you're doing is loading an external file and executing it in-line (though use does this in the equivalent of a BEGIN { } block, so in a way this all happens before anything else is executed in your script). Usually you see a package declaration in these files, which cause the new subroutines to be declared in a new namespace, but otherwise code that isn't in a subroutine is executed like any other.
I'm over-simplifying here, since a file is a 'block' with respects to variable scoping, but that's about the only thing multiple files do that's different.
The bottom line is that since your additional code towards the bottom isn't declared in a subroutine, it will never be reached because you are dieing. A package directive doesn't do all that much, and certainly doesn't do what you think it does.
|
|---|