Help for this page

Select Code to Download


  1. or download this
    It returns the number of files successfully deleted.  Symlinks are
    treated as ordinary files.
    ...
    using C<$SIG{__WARN__}>; it is not apparent from the return value.
    Therefore, you must be extremely careful about using C<rmtree($foo,$ba
    +r,0>
    in situations where security is an issue.
    
  2. or download this
    unless (unlink $root) {
      carp "Can't unlink file $root: $!";
    ...
      }
      last;
    }
    
  3. or download this
    $SIG{'__WARN__'} = sub { die $_[0] };
    rmtree("/tmp/tempdir",0,1);
    $SIG{'__WARN__'} = 'DEFAULT';