# NOTE: Derived from blib/lib/Inline.pm.
# Changes made here will be lost when autosplit is run again.
#line 1200 "blib/lib/Inline.pm (autosplit into blib/lib/auto/Inline/_rmtree.al)"
$roots = [$roots] unless ref $roots;
foreach $root (@{$roots}) {
if (opendir MYDIR, $root) {
croak M21_opendir_failed($root);
my $dot = File::Spec->curdir();
my $dotdot = File::Spec->updir();
foreach my $name (@names) {
next if $name eq $dot or $name eq $dotdot;
my $maybefile = File::Spec->catfile($root,$name);
push(@paths,$maybefile),next if $maybefile and -f $maybefile;
push(@paths,File::Spec->catdir($root,$name));
($root) = $root =~ /(.*)/ if UNTAINT;
rmdir($root) or croak M54_rmdir_failed($root);
($root) = $root =~ /(.*)/ if UNTAINT;
unlink($root) or croak M55_unlink_failed($root);