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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |