in reply to Re^2: Pass array, then clear
in thread Pass array, then clear
The fact that you can modify a function argument within the function (provided you really know what you're doing) does not mean, however, that you should do it or that it is a good practice to do so commonly. I do not know whether this is by itself a sufficient reason not to modify the subroutine arguments, but I agree with BillKSmith that most people (including myself) think is is usually a bad idea to do so. Or that, at least, it tends to be confusing and should be avoided when possible.
Having said that, I am certainly not dogmatic on that question, and I prefer to be pragmatic. I certainly usually tend not to modify my subroutines arguments, even though I sometimes find it useful or even necessary to do so (which can be the case for totally different reasons, such as performance or memory footprint, for example).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Pass array, then clear
by jahero (Pilgrim) on Jan 17, 2018 at 06:33 UTC | |
by hippo (Archbishop) on Jan 17, 2018 at 09:31 UTC | |
by jahero (Pilgrim) on Jan 17, 2018 at 10:39 UTC |