Re: trying to use IO::Handle



On Sun, Apr 13, 2008 at 9:21 PM, Richard Lee <rich.japh@xxxxxxxxx> 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.
.



Relevant Pages

  • Re: How to eliminate this global variable, silent?
    ... The Standard does NOT say that there are no ... *are* global variables in C, but you seem loathe to provide either the ... What's the big secret ...
    (comp.lang.c)
  • Re: Globals
    ... Both the languages you've mentioned provide for the ... use of global variables, ... so small projects written in scripting languages allow ...
    (comp.lang.cpp)
  • Re: EVENT variables
    ... entire aspect of the language, because it has become effectively obsolete, which is what I said over a week ago. ... Current programming practice is to use threads if buffering is not satisfactory, operating systems reflect that, and so does current PL/I. ...
    (comp.lang.pl1)
  • Re: No Root Shell with SUID /bin/bash
    ... On Saturday 20 April 2002 08:22, Peter Pan wrote: ... Wouldn't it be an idea to postpone that setuidto _after_ you're ... but it's a matter of good programming practice. ...
    (Focus-Linux)
  • Re: a simple reference variable question
    ... You probably know that global variables are not accessible unless ... function & getX() { ... Anyway, probaly not the problem in your real code, since global is not ...
    (alt.php)