use strict ; my $src; my $dst; print "\nEnter Source Directory(with trailing slash): "; chomp($src = ); $dst2 =~ s/inbox/queue/g; print "\nDESTINATION DIRECTORY SET TO: $dst2\n"; my $count; my $limit; print "\nEnter File Limit: "; chomp($limit = ); $count = 1; opendir(DIR, $src) || (print "\nError with your source dir" && return); while (my $file = readdir(DIR)) { my $full_path = $SRC . $file; open FILE, "< $full_path" || (print "\nCannot open file: $file" && return); #http://www.perl.com/doc/manual/html/pod/perlfunc/stat.html my @file_stats = stat FILE; my $mod_time = $file_stats[9]; my @sys_args = ("mv", $full_path, $new_path); my $mv_return = system(@sys_args); close FILE; } closedir(DIR);