I have not found an explanation as to why Perl was created like this. Surely there must be a reason for it...
I think this is due to the relationship between use being like a require in a BEGIN, which in turn is like a do FILE, which in turn is like an eval. eval returns undef when its code fails, and do also has slightly more complex error cases:
unless ($return = do $file) { warn "couldn't parse $file: $@" if $@; warn "couldn't do $file: $!" unless defined $return; warn "couldn't run $file" unless $return; }
As a side note: Acme::ReturnValue
In reply to Re: Modules return value
by haukex
in thread Modules return value
by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |