use POSIX; use File::Copy; my $WLpath = '\\\\10.1.1.5\\Weblogiclogs\\' . strftime( '%y%m%d%H%M', localtime); ######################################## # Creating directory based on time stamp ######################################## { mkdir $WLpath or die "Couln't create $WLpath because $!($^E)\n"; } ############## sub Move_Logs ############## { my $logs = "\\\\192.168.2.5\\Weblogiclogs\\*.log"; my $target = $WLpath; move("$logs", "$target") or die ("move from $target to $logs was unsucessful because - $!($^E)\n"); }