in reply to system command aborts without exit code
Your post is far too long and verbose for me to read in its extension. But you have at least conveniently marked the problematic line:
system $merker2;
Never run system without checking its result:
system $merker2 == 0 or die "Couldn't launch [$merker]: $!/$?";
... or, if you want to continue even though the external command failed/was not launched, just output a warning instead. Maybe consider putting all those system() calls into one central routine that logs the command, runs it and outputs errors:
sub run_command { my ($cmd) = @_; warn "Running [$cmd]\n"; system($cmd) == 0 or die "Couldn't launch [$cmd]: $!/$?"; };
|
|---|