I'm trying to find out why a particular Perl script is experiencing errors on a move command. Here's the line that's erroring:
move( "$file", "$homeDir/trash/" ) or $err1 = "Y";
I want to capture the exit status of the move command, but still make sure the err1 variable gets set to Y, since there's logic built around that in the script. Can I do something like this?
move( "$file", "$homeDir/trash/" ) or ( $err1 = "Y" and print $? );
Otherwise what's the best way for me to accomplish this? Thanks!
move( "$file", "$homeDir/trash/" ) or $err1 = "Y";
I want to capture the exit status of the move command, but still make sure the err1 variable gets set to Y, since there's logic built around that in the script. Can I do something like this?
move( "$file", "$homeDir/trash/" ) or ( $err1 = "Y" and print $? );
Otherwise what's the best way for me to accomplish this? Thanks!