1. But Why does most of the identifiers are getting printed under the scalars. ( check some package names are also printed under the scalars, if it is printed under packages it is right, but why here ?? )

I suspect that all the identifiers are getting printed under "scalars"...

Background: the entry for an identifier is a reference to a GLOB (unless it's a late model 'constant', in which case it may be a reference to a SCALAR, ARRAY or HASH). A GLOB contains a pointer to the various different things that the identifier may refer to -- SCALAR, ARRAY, HASH, CODE, etc -- and the (eg) *foo{HASH} construct will return the respective pointer.

Kicker: for everything except SCALAR, (eg) *foo{HASH} will return undef when no HASH has been defined. For SCALAR the pointer is always defined, but the value it points to may be undef. This means that it's not possible to distinguish between a SCALAR that has been declared but whose value is undef, and a SCALAR that has never actually been declared.

I had a look at Devel::Symdump. It thinks that a SCALAR exists if the pointer *ENTRY{SCALAR} is defined. It could test to see if what is pointed to is also defined, but then it would miss a declared SCALAR which has not yet been defined. There just isn't a completely right answer to this :-(

2. Only the package names ends with :: in the identifier, why is it so ?? others does not.

This is easier... you may be thinking of the '::' as separators. In effect they are part of the package name. But, since they come at the end of the name they can also be treated as separators...

3. While trying to print the scalars, some got printed and some does not. Why +, - are used as default, and what is the use of it. ??

I'm sorry, you lost me here... If you mean that you tried printing the scalar value of everything listed as a Scalar by Devel::Symdump, then the above explains why many will have undef SCALAR parts.

As for what $+ and $^O are, I refer you to perlvar.


In reply to Re: Devel::Symdump - doubts in the output got. by gone2015
in thread Devel::Symdump - doubts in the output got. by sathiya.sw

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.