if ( $pbOnDStarMachine == 1 ) { my ($sComm) = "sudo dchown foo \'$this->{sFullPath}\'"; try { libs::exec("$sComm"); } catch err with { my ($ex) = @_; dPrt("warn","$ex"); } otherwise { my ($ex) = @_; dPrt("warn","OTHERWISE:$ex"); }; return ""; } #### sub exec { my ($comm) = @_; if ( dbg::debugOn() ) { dPrt("dbg","Debug, Would execute:\n$comm"); } else { dPrt("libs_verbose","Executing:$comm"); system("$comm"); if ($? == -1) { throw err("system command returned -1: $comm\nReason $!"); } elsif ($? & 127) { my ($sSig) = $? & 127; throw err("Command died with signal $sSig :$comm"); } else { my ($nExitVal) = $? >> 8; if ( $nExitVal != 0 ) { throw err("Command exited with value $nExitVal :$comm"); } } }