The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
Changes 039
META.json 23
META.yml 89
README 12
SIGNATURE 1111
lib/Devel/Symdump.pm 324
t/symdump.t 1928
7 files changed (This is a version diff) 44116
@@ -1,3 +1,42 @@
+2015-06-11  k  <andk@cpan.org>
+
+	* release 2.15
+
+	* In the tests, always check for exists before checking for
+	definedness (Reini Urban)
+
+2014-12-16  k  <andk@cpan.org>
+
+	* release 2.14
+
+	* no change to 2.14-TRIAL
+
+2014-12-08  k  <andk@cpan.org>
+
+	* release 2.14-TRIAL
+
+	* support for fileno() on directory handles (perl commit v5.21.6-337-g67f2cc7)
+
+2014-07-26  k  <andk@cpan.org>
+
+	* release 2.13-TRIAL
+
+	* support for telldir (Brian Fraser)
+
+2014-06-20  k  <andk@cpan.org>
+
+	* release 2.12
+
+	* test rewrite: v5.21.0-424-ge35475d stopped supporting
+	defined(@$ref) which was used in t/symdump.t (thanks to Aaron
+	Crane for spotting)
+
+2013-10-30  k  <andk@cpan.org>
+
+	* release 2.11
+
+	* v5.19.5-71-gd456e3f stopped producing the %@ hash at startup
+
 2013-03-27  k  <k@k83.linux.bogus>
 
 	* release 2.10
@@ -4,7 +4,7 @@
       "Andreas Koenig <andreas.koenig.gmwojprw@franz.ak.mind.de>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "ExtUtils::MakeMaker version 6.6501, CPAN::Meta::Converter version 2.120921",
+   "generated_by" : "ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150005",
    "keywords" : [
       "symbol table inspection"
    ],
@@ -47,5 +47,6 @@
          "url" : "git://github.com/andk/devel-symdump.git"
       }
    },
-   "version" : "2.10"
+   "version" : "2.15",
+   "x_serialization_backend" : "JSON::PP version 2.27300"
 }
@@ -3,26 +3,27 @@ abstract: 'dump symbol names or the symbol table'
 author:
   - 'Andreas Koenig <andreas.koenig.gmwojprw@franz.ak.mind.de>'
 build_requires:
-  ExtUtils::MakeMaker: 0
+  ExtUtils::MakeMaker: '0'
 configure_requires:
-  ExtUtils::MakeMaker: 0
+  ExtUtils::MakeMaker: '0'
 dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.6501, CPAN::Meta::Converter version 2.120921'
+generated_by: 'ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150005'
 keywords:
   - 'symbol table inspection'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
-  version: 1.4
+  version: '1.4'
 name: Devel-Symdump
 no_index:
   directory:
     - t
     - inc
 requires:
-  Compress::Zlib: 0
-  Test::More: 0
-  perl: 5.004
+  Compress::Zlib: '0'
+  Test::More: '0'
+  perl: '5.004'
 resources:
   repository: git://github.com/andk/devel-symdump.git
-version: 2.10
+version: '2.15'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.016'
@@ -131,7 +131,8 @@ SUBCLASSING
     Devel::Symdump package and turns them into functions.
 
 SEE ALSO
-    Package::Stash
+    Routines for manipulating stashes: "Package::Stash"; to work with
+    lexicals: "PadWalker".
 
 AUTHORS
     Andreas Koenig <andk@cpan.org> and Tom Christiansen <tchrist@perl.com>.
@@ -1,5 +1,5 @@
 This file contains message digests of all files listed in MANIFEST,
-signed via the Module::Signature module, version 0.70.
+signed via the Module::Signature module, version 0.79.
 
 To verify the content in this distribution, first make sure you have
 Module::Signature installed, then type:
@@ -14,13 +14,13 @@ not run its Makefile.PL or Build.PL.
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-SHA1 87258f01833a67d06698a8cbd65f91d405c28102 Changes
+SHA1 0db9bcf95981556302e06db39b2758191593c63c Changes
 SHA1 1a8c5d596cff0111353e14fa44e6caca7cce8c13 MANIFEST
-SHA1 3435feb135d6354c3b72395858f1da94a50221fe META.json
-SHA1 1a2880a91a3b315d4281658feeef906c05b28c92 META.yml
+SHA1 9d42d82b27deeee1eed560ae9f4bb6e1eb74bd86 META.json
+SHA1 0ef7a02c74bbb5b4865f1ba8168b9b27afc9af28 META.yml
 SHA1 a58477f4ebc16c72b70c3c3bd8981bf808598d70 Makefile.PL
-SHA1 6cf5689752f21ac49c634e92588ee882b2bca6de README
-SHA1 564c447143e90c90c4213b3ec8a77ad38ec3d79b lib/Devel/Symdump.pm
+SHA1 5db31f42fa30d51489b21e2687781c054527d3b3 README
+SHA1 492b7d5d10a8e4ba8b759da040ecff1dfd05be1f lib/Devel/Symdump.pm
 SHA1 fef2e4c5ea88bd09f2af618e32a58ee87be965a4 lib/Devel/Symdump/Export.pm
 SHA1 6fbcf9e39c02e9889a6d8bf9cb2c6444967dc841 t/autogen.t
 SHA1 ac80cb093bffdce80ea28209197e58ec40b0cdd4 t/diff.t
@@ -29,12 +29,12 @@ SHA1 2854efb6fa5bd953348c47b156be8618cf10e74e t/glob_to_local_typeglob.t
 SHA1 835eaa7ac1ac82351bcc0f8fca734ed539459a95 t/pod.t
 SHA1 61383cc359764b3323e77a07ebf846f215331d34 t/podcover.t
 SHA1 a3c92f14ca7be245384a8a9f1425f6b99c2f42f1 t/recur.t
-SHA1 2713852654d6d7a133694e75122cefa2db5c37c4 t/symdump.t
+SHA1 eb77a889d1fbfc55658cb80e9791c63b10b369bd t/symdump.t
 SHA1 d7e8e57a5c9676c8fd716b6b0fe13559c83d8711 t/tree.t
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.12 (GNU/Linux)
+Version: GnuPG v1
 
-iEYEARECAAYFAlFShTMACgkQ7IA58KMXwV2SsQCfaBr7lSbtVwBqFPRKwoBVKxTl
-AaUAoIMw/U3e9iDx01U46LUDz9Xt1bks
-=S+YN
+iEYEARECAAYFAlV4+lsACgkQ7IA58KMXwV3gqgCg6D8U8nUoz1f/zs0Luubsu+Mi
+w/MAn1vgr3AJbT7Y9NodxXlevYodMpiX
+=tmM1
 -----END PGP SIGNATURE-----
@@ -5,7 +5,7 @@ use Carp ();
 use strict;
 use vars qw($Defaults $VERSION *ENTRY $MAX_RECURSION);
 
-$VERSION = '2.10';
+$VERSION = '2.15';
 $MAX_RECURSION = 97;
 
 $Defaults = {
@@ -288,12 +288,32 @@ AUTOLOAD {
 	if ($compat eq "file") {
 	    @syms = grep { defined(fileno($_)) } @syms;
 	} else {
-	    @syms = grep { defined(telldir($_)) } @syms;
+	    @syms = grep { _is_dirhandle($_) } @syms;
 	}
     }
     return @syms; # make sure now it gets context right
 }
 
+use Config ();
+use constant HAVE_TELLDIR => $Config::Config{d_telldir};
+sub _is_dirhandle {
+    my ($glob) = @_;
+    if ( HAVE_TELLDIR ) {
+        return defined(telldir($glob));
+    }
+    else {
+        if ( !ref $glob ) {
+            no strict 'refs';
+            $glob = \*{$glob};
+        }
+        require B;
+        my $obj = B::svref_2object($glob);
+        return if !$obj || !eval{ $obj->IO; $obj->IO->IoTYPE; 1 };
+        my $mode = $obj->IO->IoTYPE;
+        return $mode eq "\0" ? 1 : 0;
+    }
+}
+
 1;
 
 __END__
@@ -450,7 +470,8 @@ Devel::Symdump package and turns them into functions.
 
 =head1 SEE ALSO
 
-Package::Stash
+Routines for manipulating stashes: C<Package::Stash>; to work with
+lexicals: C<PadWalker>.
 
 =head1 AUTHORS
 
@@ -39,7 +39,9 @@ $a = "@a";
 ok (
     $a eq "main::DATA main::Hmmmm main::STDERR main::STDIN main::STDOUT main::stderr main::stdin main::stdout"
     ||
-    $a eq "main::ARGV main::DATA main::Hmmmm main::STDERR main::STDIN main::STDOUT main::i_am_the_symbol_printing_format_lest_there_be_any_doubt main::stderr main::stdin main::stdout",
+    $a eq "main::ARGV main::DATA main::Hmmmm main::STDERR main::STDIN main::STDOUT main::i_am_the_symbol_printing_format_lest_there_be_any_doubt main::stderr main::stdin main::stdout"
+    ||
+    $a eq "main::DATA main::DOT main::Hmmmm main::STDERR main::STDIN main::STDOUT main::stderr main::stdin main::stdout", # v5.21.6-337-g67f2cc7
     $a
    );
 
@@ -55,6 +57,8 @@ ok (
     ||
     $a eq "^H @ ENV INC SIG"     # ^H hints 27643 (?)
     ||
+    $a eq "^H ENV INC SIG"       # v5.19.5-71-gd456e3f
+    ||
     $a eq "@ ENV INC SIG"
     ||
     $a eq "ENV INC SIG",
@@ -66,7 +70,7 @@ $t = 'arrays';
 $a = "@a";
 #write;
 like (
-      $a, "/main::INC.*main::_.*main::a/"
+      $a, "/main::INC.*main::_.*main::a/", "packsort arrays"
      );
 
 eval {
@@ -75,7 +79,7 @@ eval {
 $a = $@ ? $@ : "@a";
 like ($a,
       "/^invalid Devel::Symdump method: really_bogus\(\)/",
-     );
+      "really_bogus");
 
 $sob = rnew Devel::Symdump;
 
@@ -85,7 +89,7 @@ for (active_packages($sob)) {
 }
 $a="@m";
 like ($a,
-      "/Carp.*Devel.*Devel::Symdump.*Devel::Symdump::Export.*DynaLoader.*Exporter.*Hidden.*big::long::hairy.*funny::little.*strict/");
+      "/Carp.*Devel.*Devel::Symdump.*Devel::Symdump::Export.*DynaLoader.*Exporter.*Hidden.*big::long::hairy.*funny::little.*strict/", "active_packages");
 
 my %m=();
 for (active_modules($sob)) {
@@ -93,12 +97,11 @@ for (active_modules($sob)) {
 }
 $a = join " ", keys %m;
 #print "[$a]\n";
-ok (exists $m{"Carp"} &&
-    exists $m{"Devel::Symdump"} &&
+ok (exists $m{"Devel::Symdump"} &&
     exists $m{"Devel::Symdump::Export"} &&
     exists $m{"Exporter"} &&
     exists $m{"strict"} &&
-    exists $m{"vars"});
+    exists $m{"vars"}, "active_modules");
 
 # Cannot test on the number of packages and functions because not
 # every perl is built the same way. Static perls will reveal more
@@ -132,7 +135,7 @@ for $type ( qw{
 	}
     }
 
-    ok (@syms >= $Expect{$type});
+    ok (@syms >= $Expect{$type}, $type);
 }
 
 exit;
@@ -141,17 +144,23 @@ sub active_modules {
     my $ob = shift;
     my @modules = ();
     my($pack);
-    for $pack ("main", $ob->packages) {
-	if (
-		defined &{ "$pack\::import"   } 	||
-		defined &{ "$pack\::AUTOLOAD" } 	||
-		defined @{ "$pack\::ISA"      }	||
-		defined @{ "$pack\::EXPORT"   }	||
-		defined @{ "$pack\::EXPORT_OK"}
-	    )
-	{
-	    push @modules, $pack;
-	}
+    for $pack ("main", sort $ob->packages) {
+        no strict 'refs';
+        my %stash = %{"$pack\::"};
+        # With restricted hashes we need to check with exists first
+        # XXX Core limitation: copying to %stash removes the READONLY flag
+        my $restricted = Internals::SvREADONLY(%{"$pack\::"});
+        #warn (($restricted ? "" : "un")."restricted $pack\::\n");
+      FUNCS:
+        for my $f (qw(import AUTOLOAD ISA EXPORT EXPORT_OK)) {
+            if (!$restricted or exists($stash{$f})) {
+                if (defined &{ "$pack\::$f"}) {
+                    push @modules, $pack;
+                    #warn "$pack \n";
+                    last FUNCS;
+                }
+            }
+        }
     }
     return sort @modules;
 }