$oldlocation = "/perl/ass/$logfiles[$hour]"; #Cut and Pastes the log file into corresponding folder $newlocation = "/perl/ass/$folder[$N]/$logfiles[$hour]"; print " old = $oldlocation \n new = $newlocation\n"; move($oldlocation, $newlocation) or die "File cannot be moved: $!";