--- Bob Bondi <[EMAIL PROTECTED]> wrote:
> I had wanted to keep all the declarations in a section and the subs
> in a section and the main script at the bottom, but, I find I must
add
> code in the declaration section!

I like to keep "sections" too, though the parser doesn't care so much.
Try this:

BEGIN { 
  die "<<<Not enough arguments to get started>>\n -h for help\n"
      unless @ARGV;;
  die<<__END if grep /^-h/, @ARGV; # simpler, more forgiving

     This is the help message stuff as a here document.
     (It's also great for documentation,
      since it's here at the top of the code,
      and readably set off to itself!)

__END
}

That sets it off as significant, and runs it before bothering to load a
bunch of other modules and pragmas that you won't need if the program
was just run for help. You can out some of the use() statements above
it if you like ( such as Carp =o)  but this lets you keep them all
together if you prefer.


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to