Non blocking question:

Why make this a subroutine?  As this is your executable and it's not reusable code, making this a subroutine doesn't gain you anything over using it in an interpreted fashion.