in reply to Devel::Symdump without Devel::Symdump interference

Seems to work ok here. My test file looks like this
no strict; # 1 # 2 # 3 # 4 sub foo { } # 5 @bar = \&foo; # 6 $baz = "a string"; # 7 %this = qw/une deux/; # 8 # 9 # 10
And I get the following (unsightly) output
arrays ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: bar functions ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: foo hashes ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: this ios packages scalars ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: BEGIN ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: bar ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: baz ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: foo ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: this unknowns arrays ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: bar functions ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: foo hashes ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: this ios packages scalars ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: BEGIN ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: bar ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: baz ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: foo ThisIsAnotherPackageAndMostLikelyWillNeverCollideWithAnyOtherN +amespace:: this
Also, your script will always slurp the number of lines as provided by the last argument, which would seem to be unintended behaviour.

As for alternatives, you might want to look at Data::Dumper or the much more accurate Data::Dumper::Streamer for displaying the contents of a symbol table.

HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: Devel::Symdump without Devel::Symdump interference
by eXile (Priest) on Apr 20, 2004 at 01:51 UTC
    I'm sorry to not have posted my test scripts, but they were full of my and strict, opposed to your no strict test script. Do you (or anybody else) know why that matters in this case? I supposed the my variables were in scope of the package-with-the-long-name?