SPUG: Predeclaring packages

Yitzchak Scott-Thoennes sthoenna at efn.org
Thu Jan 1 00:12:05 PST 2009


On Wed, December 31, 2008 7:36 pm, Christopher Howard wrote:
> Question: Is there a way to predeclare packages, without moving the
> package to a separate file?
>
> This is my issue: When I write a script, I like to use packages to keep
> everything nice and neat. And I like to have subs and packages after the
> 'initializing' part of the program, so it is easy to find. So what I'm
> doing now is something like this:
>
> ### EXAMPLE START ###

> This doesn't work because $timer is not predeclared along with the
> subroutines.

There's something you're missing, but I'm not completely sure
what it is.  Can you explain more what isn't working?

Your example should work just fine, though the predeclarations
are unnecessary.  Remember that first your entire script is compiled,
including the sub definitions, and then it begins executing.



More information about the spug-list mailing list