in reply to Code review: function to trim whitespace from all items in a list
I personally don't have a problem with modification of the input; my own trim functions in various incarnations do just that, most of the time in-situ & returning nothing.
If your code expects the input given not to be fiddled with, then the trim function should make a copy of the input to work on. In either case, I would expect a note about input modifications in pod, saving me from a code dive.
Devoid of pod, the function needs to work on a copy of the input & not touch input any further. Thus working with P::C.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Code review: function to trim whitespace from all items in a list
by LanX (Saint) on Nov 21, 2014 at 15:14 UTC |