#!perl -w # # Archiver for processed EDI messages # - move all messages to existing subfolder *\yyyy\mm\dd use strict; use warnings; use Time::Piece; use File::Find; use File::Copy; # no idea if I need all of these or not my $base = 'D:\Some\Specific\Folder\\'; my @time = localtime; my $mday = $time[3]; my $month = $time[4] + 1; $month = sprintf("%02d", $month); my $year = $time[5]+1900; my $from = $base.*\.'.txt'; # THE PROBLEM print ($from); # just a check to see what is used as $from, if anything # will obviously be left out when the rest works my $to = $base.$year."\\".$month."\\".$mday."\\"; # this folder already exists move($from,$to) or die $!; # might also be (part of) the problem print "moved ".$from." to ".$to; # a check to see what has been moved, if anything exit 0;