use warnings; use strict; use File::Copy qw(move); use File::Spec; use Cwd qw(abs_path); use File::Find; my $path = $ARGV[0]; my $final_dir = File::Spec->rel2abs("./report"); $path = abs_path($path); find( sub { chomp; return if $_ eq '.' or $_ eq '..'; move( $_, $final_dir ); }, $path );