On Sun, Apr 13, 2008 at 9:21 PM, Richard Lee <[EMAIL PROTECTED]> wrote: snip > does subroutine introduce additional delay? snip
Yes, there is a non-trivial amount of work done setting up a function call; however, since you are only calling it once that isn't a big deal. My rule of thumb for creating functions is: I need a function if I use this code repeatedly or the code is complex and ruins the flow of the main script. In general, the later is rare. snip > I am trying to write a lot of perl and trying to organize my program in > case I need to modulalize it. Well, I just like > having pretty much all function in sub. > Also trying to learn subroutine.. snip If a piece of code doesn't get used repeatedly, it doesn't deserve modularization. Also, you said in an earlier post that you were using a global variable (@bad I think), using global variables defeats modularization and is bad programming practice to boot. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/