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.
In reply to Re: Code review: function to trim whitespace from all items in a list
by Anonymous Monk
in thread Code review: function to trim whitespace from all items in a list
by eyepopslikeamosquito
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |