use File::Path; my $dir = '/to_remove'; rmtree([$dir], 0, 0);