From b775e6bae012223b0a5cf674d4a41f12f635fb75 Mon Sep 17 00:00:00 2001 From: Peter Dintelmann Date: Wed, 22 Nov 2006 18:41:55 +0100 Subject: POSIX::remove() and directories From: "Dintelmann, Peter" Message-ID: <3852726AFA94DE4F87E616F13F416A5F0A912F@naimucu1.ffz00k.rootdom.net> p4raw-id: //depot/perl@29353 --- ext/POSIX/POSIX.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/POSIX') diff --git a/ext/POSIX/POSIX.pm b/ext/POSIX/POSIX.pm index a67f8833ca..617d999828 100644 --- a/ext/POSIX/POSIX.pm +++ b/ext/POSIX/POSIX.pm @@ -421,7 +421,7 @@ sub puts { sub remove { usage "remove(filename)" if @_ != 1; - CORE::unlink($_[0]); + (-d $_[0]) ? CORE::rmdir($_[0]) : CORE::unlink($_[0]); } sub rename { -- cgit v1.2.1