in reply to Is this a good approach for reducing number of global variables?
I think that the use of globals increases as the program increases in size and complexity - it becomes simpler and sometimes clearer to pass half a dozen variables througha global hash than directly to the subroutine.
Perl gives us alot of power for quick hacks, simple tools, fast fixes. For example, returning the last thing evaluated, providing a default variable ( $_ ) for just about everything means I can construct, say, a script which changes every url in a couple of HTML files, in about five minutes. But most of those features are inappropriate for a program of any size where your spending days working on it anyway, the twenty minute time gain of using them isn't worth in terms of a lost of readability and reuse.
Cheers,
|
---|
Replies are listed 'Best First'. | |
---|---|
Re(2): Is this a good approach for reducing number of global variables?
by FoxtrotUniform (Prior) on Mar 19, 2002 at 17:09 UTC |