You mean like this?
Originally Posted by loell
open(CONFIG , $filename) ||
$RETVAL=1; die "$filename is not available.\n";
If there isn't a way to combine two commands after the or (||) statement, what is the best way to capture the fact that the file open failed before the next part of the code executes? If I can do that, I can set the return value and break out of the subroutine. That's why I asked about eval as well, I just don't know how to use it effectively.
Can't modify logical or (||) in scalar assignment at (./scriptname) line 148, near "1;"
Execution of (./scriptname) aborted due to compilation errors.