in reply to Re^6: Making a variable in a sub retain its value between calls
in thread Making a variable in a sub retain its value between calls
I assure you, it certainly isn't a tomayto-tomahto difference of opinion. This isn't about opinions. This is about not putting extremely excessive limitations on your code without reason. I get the feeling that you don't realize how far the consequences propagate -- the consequences go far beyond your reach as a module author. (Yes, the world will probably end, too. ;-)) Any user that uses your module will be effected by this completely useless limitation.
See CHECK and INIT under mod_perl and call a modules INIT-section for examples of when INIT can cause trouble. (The second problem is completely unnecessary and wouldn't have been a problem if the author would've understood the purpose of INIT, as I point out in my reply.)
Reply to the update:
Right, if you use it only for scripts it's OK, but if I'll have an opinion then it's that it's far better to use a solution that, in general, always works over a solution that, in general, sometimes works.
I'm curious. When do you need to use INITs to delay execution after all BEGIN blocks in scripts?
ihb
See perltoc if you don't know which perldoc to read!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Making a variable in a sub retain its value between calls
by tlm (Prior) on Apr 19, 2005 at 01:22 UTC | |
by ikegami (Patriarch) on Apr 19, 2005 at 04:49 UTC | |
by tlm (Prior) on Apr 19, 2005 at 05:46 UTC | |
by ikegami (Patriarch) on Apr 19, 2005 at 19:09 UTC | |
by ihb (Deacon) on Apr 19, 2005 at 16:08 UTC | |
by TimToady (Parson) on Apr 19, 2005 at 16:28 UTC |