diff options
Diffstat (limited to 'lib/File/Path.pm')
-rw-r--r-- | lib/File/Path.pm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 225ecab4b6..3a859db779 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -103,7 +103,7 @@ use Exporter (); use strict; use vars qw( $VERSION @ISA @EXPORT ); -$VERSION = "1.0401"; +$VERSION = "1.0402"; @ISA = qw( Exporter ); @EXPORT = qw( mkpath rmtree ); @@ -148,10 +148,17 @@ sub rmtree { my($roots, $verbose, $safe) = @_; my(@files); my($count) = 0; - $roots = [$roots] unless ref $roots; $verbose ||= 0; $safe ||= 0; + if ( defined($roots) && length($roots) ) { + $roots = [$roots] unless ref $roots; + } + else { + carp "No root path(s) specified\n"; + return 0; + } + my($root); foreach $root (@{$roots}) { $root =~ s#/$##; |