Returning a nonsense result that the programmer will puzzle over makes sense to me because strange answers are a clue that you are doing something wrong. Returning something sort of sensible may make the mistake less immediately apparent. Putting an explicit error makes more sense still - if you want to put the effort out. Retrofitting a 2 line map into an existing function is easier than rewriting it.
In reply to Re: Re: Re: Re: What should be returned in scalar context?
by tilly
in thread What should be returned in scalar context?
by tilly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |