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


In reply to Re: Devel::Symdump without Devel::Symdump interference by broquaint
in thread Devel::Symdump without Devel::Symdump interference by eXile

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.