smanicka has asked for the wisdom of the Perl Monks concerning the following question:
i have a code like this:
I actually need to be able to write different stuff into the log based on whether the move succeeds or not.How can I do that?if(-e "$newlocationlocation"){ move ($oldlocation,$newlocation) or warn "failed to move to folder"; print LOGFILE "$theTime,moved,$oldlocation,$folder\n"; } else{ my $perm=775; mkdir ($newlocation,$perm) or &on_err("Error making Directory\n"); move ($oldlocation,$newlocation) or warn "failed to move to folder"; print LOGFILE "$theTime,moved,$oldlocation,$folder\n"; }
thanks
Sandhya
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: how to find out if move succeeds?
by Roy Johnson (Monsignor) on Feb 25, 2009 at 17:48 UTC |