May I ask how you could justify the should in your sentence?
You've already explained why. If you return undef, you can't determine if an error occurred. As you put it, "the caller can not distinguish between the case of the code in the filename returning undef, or Perl being unable to open the file".
It is not a bug, but undefined behaviour
It's not undefined behaviour. The result of the function can be ambiguous, but the behaviour is defined.
In reply to Re^5: Why do we need a \n with do FILENAME?
by ikegami
in thread Why do we need a \n with do FILENAME?
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |