in reply to 'do' read file
You need to be a little more careful about how you handle the return value of do:
If do cannot read the file, it returns undef and sets $! to the error.
If do can read the file but cannot compile it, it returns undef and sets an error message in $@ .
Always check $@ first, as compilation could fail in a way that also sets $! .
If the file is successfully compiled, do returns the value of the last expression evaluated.
(Emphasis mine.)
You're testing for a false return value... but you could get a false value even if do succeeding in reading and executing the file.
|
---|