I have the below “system command” for moving the file. Is it good to use File::Move command or the use the below one. In case if File::Move is better, how can I use it?
system("mv $LOGPATH/test/work/LOGFILE $LOGPATH/test/done/$LOGFILE") == 0
or WriteLog(ERROR, "mv command Failed $LOGPATH/test/work/$LOGFILE status was $?");
The function you are looking for is in File::Copy:
File::Copy is part of the standard distribution of Perl itself.
You can of course use a
system ("mv ...")command to do the same thing. The advantages of File::Copy are:/Library/Application Support/Hi I'm On A Mac/;systemswamps everything else.File::Copy::moveandrenamehave about the same cost, so you may as well use the safermovewhich works across filesystems.