summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul "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
commit76e3b563bc78e0762abf833d7ad0f3f151a6860b (patch)
treeb7084547887a68589272e09951133a20a9574dde
parentb262f7131f65ee76968fbc067a6fe6df84a49fd2 (diff)
downloadperl-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.pm5
-rw-r--r--ext/POSIX/t/export.t4
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);