diff options
author | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2012-02-01 19:06:59 +0000 |
---|---|---|
committer | Ævar Arnfjörð Bjarmason <avar@cpan.org> | 2012-02-11 22:22:25 +0000 |
commit | 76e3b563bc78e0762abf833d7ad0f3f151a6860b (patch) | |
tree | b7084547887a68589272e09951133a20a9574dde | |
parent | b262f7131f65ee76968fbc067a6fe6df84a49fd2 (diff) | |
download | perl-76e3b563bc78e0762abf833d7ad0f3f151a6860b.tar.gz |
Actually implement @EXPORT_OK of strptime correctly; delete'ing an undef element yields false so ... and push ... would never have worked
-rw-r--r-- | ext/POSIX/lib/POSIX.pm | 5 | ||||
-rw-r--r-- | ext/POSIX/t/export.t | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/ext/POSIX/lib/POSIX.pm b/ext/POSIX/lib/POSIX.pm index 98d634d9a0..88f3ddeda1 100644 --- a/ext/POSIX/lib/POSIX.pm +++ b/ext/POSIX/lib/POSIX.pm @@ -393,7 +393,10 @@ our %EXPORT_TAGS = ( # Symbols that should not be exported by default because they are recently # added. It would upset too much of CPAN to export these by default - delete $export{$_} and push @EXPORT_OK, $_ for qw(strptime); + foreach (qw(strptime)) { + delete $export{$_}; + push @EXPORT_OK, $_; + } # Doing the de-dup with a temporary hash has the advantage that the SVs in # @EXPORT are actually shared hash key scalars, which will save some memory. diff --git a/ext/POSIX/t/export.t b/ext/POSIX/t/export.t index 07d428eb1a..0753178f63 100644 --- a/ext/POSIX/t/export.t +++ b/ext/POSIX/t/export.t @@ -102,8 +102,8 @@ my %expect = ( getpgrp getppid getpwnam getpwuid gmtime kill lchown link localtime log mkdir nice open opendir pipe printf rand read readdir rename rewinddir rmdir sin sleep sprintf sqrt - srand stat system time times umask unlink utime wait - waitpid write)], + srand stat strptime system time times umask unlink utime + wait waitpid write)], ); plan (tests => 2 * keys %expect); |