![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
Re(2): Is this a good approach for reducing number of global variables?by dmmiller2k (Chaplain) |
on Mar 19, 2002 at 17:45 UTC ( #152799=note: print w/replies, xml ) | Need Help?? |
"I've had several 'trivial' scripts grow well beyond thier original intent."
I continually find myself fending off the implicit patina of triviality assigned to Perl by users, evoked by the word 'script' (further bolstered by the impression, however accurate, that Perl is to UNIX what Visual Basic (et al) is to Windows). Nearly all the so-called 'one-off's I've ever written have somehow wound up either running in Production, or at least used on a regular basis ('soft' production, as it were). It has reached the point where I no longer use the word 'script' to refer to them when speaking to users, instead using the more substantive, 'program.' Toward that end I try ALWAYS to write my scripts/programs, however trivial, as though they are full-fledged applications (or soon will be). Which is to say I eschew globals, at the expense of passing values to subroutines more than perhaps efficiency would dictate. dmm If you GIVE a man a fish you feed him for a dayBut, TEACH him to fish and you feed him for a lifetime
In Section
Seekers of Perl Wisdom
|
|