Re: Sub routine location



"sunckell" <sunckell@xxxxxxxxx> wrote:
> hello everyone,
>
> I have been working with perl a lot lately. Trying to read up as
> much as I can. I am getting a little confused on how the script
> "should look". I have downloaded and reviewed code from other
> programmers, read several books, and I am seeing some discrepecies on
> the location of sub routines.
>
> My question: where should sub routines be located in a script?

I tend to put the subroutines that are the intellectual guts of the program
at the top (above the non-subroutine code) and the utility and scut-work
subroutines at the bottom.


> Should they be at the top of the script, before MAIN, or at the end of
> the script, after MAIN?

There is no Arizona. Wait, I mean there is no MAIN.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.



Relevant Pages

  • Re: Syntax Error
    ... You need to understand a little how a script "works". ... MsgBox "Starting" ... before the script starts to execute (if you misspelled the word MsgBox in ... allowed to define functions or subroutines within other blocks of code, ...
    (microsoft.public.scripting.vbscript)
  • Re: Syntax Error
    ... You need to understand a little how a script "works". ... before the script starts to execute (if you misspelled the word MsgBox ... allowed to define functions or subroutines within other blocks of code, ... to their subs and functions stored in separate files... ...
    (microsoft.public.scripting.vbscript)
  • Re: Writing my 1st VBS "Script Component"
    ... In script, though, MS has tried to make it very ... they want more money than other programmers. ... but it's supported in Vista. ... software products) are now converging. ...
    (microsoft.public.scripting.vbscript)
  • Re: Redirecting web pages
    ... .js is a file extension that people can use for javascript or jscript script ... The same goes for the .css file. ... Everything in your subroutines should only have ... ServerVariables for the Server_Name and if it is domainx or domainy, ...
    (microsoft.public.scripting.vbscript)
  • Re: Syntax Error
    ... You need to understand a little how a script "works". ... MsgBox "Starting" ... allowed to define functions or subroutines within other blocks of code, ... system object to read these files into text strings and use the execute or ...
    (microsoft.public.scripting.vbscript)