X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FPOSIX%2FPOSIX.pm;h=617d9998288f0b65992e324a66e302282b56b672;hb=2a5d9b1d41e4bafaa26126c5dea2f6ff0b72b6a7;hp=079861afa88c333927170ddc7aea944da42df2c5;hpb=42bf33b5fc7ae0d4251da5bee07d8ce557915334;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/POSIX/POSIX.pm b/ext/POSIX/POSIX.pm index 079861a..617d999 100644 --- a/ext/POSIX/POSIX.pm +++ b/ext/POSIX/POSIX.pm @@ -2,12 +2,17 @@ package POSIX; our(@ISA, %EXPORT_TAGS, @EXPORT_OK, $AUTOLOAD, %SIGRT) = (); -our $VERSION = "1.09"; +our $VERSION = "1.11"; use AutoLoader; use XSLoader (); +use Fcntl qw(FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_RDLCK F_SETFD + F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK O_ACCMODE O_APPEND + O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC + O_WRONLY); + # Grandfather old foo_h form to new :foo_h form my $loaded; @@ -416,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 { @@ -958,8 +963,13 @@ sub load_imports { ); # Exporter::export_tags(); -for (values %EXPORT_TAGS) { - push @EXPORT, @$_; +{ + # De-duplicate the export list: + my %export; + @export{map {@$_} values %EXPORT_TAGS} = (); + # Doing the de-dup with a temporary hash has the advantage that the SVs in + # @EXPORT are actually shared hash key sacalars, which will save some memory. + push @EXPORT, keys %export; } @EXPORT_OK = qw(