in reply to Re^6: Why do we need a \n with do FILENAME?
in thread Why do we need a \n with do FILENAME?
It is, in spirit, much more like eval, only that the evaluated code resides in a file, not in a string or block
The reason for requiring for avoiding undef has nothing to do with the purpose of function, so this doesn't matter.
We wouldn't place the requirment, that code evaluated by eval should return a true value unless it fails, do we?
What does matter is the interface provided by the functions. eval has a different interface, so it really doesn't matter what you do with eval. However, it is indeed quite common to have eval's body return true.
my $foo = eval ... or die("...: $@");
|
|---|