Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: trying to identify the exact data stored from dump - [ ' ];

by moritz (Cardinal)
on Jan 13, 2014 at 08:27 UTC ( #1070389=note: print w/ replies, xml ) Need Help??


in reply to Re^2: trying to identify the exact data stored from dump - [ ' ];
in thread trying to identify the exact data stored from dump - [ ' ];

You get $VAR1 = ...; $VAR2 = ...; when you pass a list or an array to Dumper, and $VAR1 = [...] if you pass an array ref.

Just wondering in what case $VAR1 will not be showing at all?

There are two options: with Dump the second parameter specifies how the variable is named; so if you pass a second argument, there'll be now $VAR1.

The other option is to set the $Data::Dumper::Purity variable, as described in the documentation.

I personally just use print Dumper $somereference; (and yes, Useqq = 1), which gives the least ambiguous output.


Comment on Re^3: trying to identify the exact data stored from dump - [ ' ];
Select or Download Code
Re^4: trying to identify the exact data stored from dump - [ ' ];
by asham (Novice) on Jan 13, 2014 at 08:48 UTC

    hi, Thanks a lot for looking into this. Kindly find my replies inline.

    You get $VAR1 = ...; $VAR2 = ...; when you pass a list or an array to Dumper, and $VAR1 = ... if you pass an array ref.

    Asham>>True, I am dealing with an array reference. And I posted two outputs one using Dumper() and one using Dump. Dump showed me only $VAR2, no $VAR1. But it does say 2 elements associated with the arrayReference.

    Just wondering in what case $VAR1 will not be showing at all?

    There are two options: with Dump the second parameter specifies how the variable is named; so if you pass a second argument, there'll be now $VAR1.

    Asham>>I did not pass any second paramter. (thought $VAR and all would be enough). Do you mean that $VAR<xy> where xy is resumed from the last left output? I think for every dump command it will start with $VAR1 unless we pass variable names to second argument of dump? right?

    The other option is to set the $Data::Dumper::Purity variable, as described in the documentation.

    Asham>>let me try this. did not use it as it was mainly for references and I am 100% sure that none of elements in my array being pointed by array reference will be perl command/object/etc.

    I personally just use print Dumper $somereference; (and yes, Useqq = 1), which gives the least ambiguous output.

    Asham>>Till now, I have found them enough but in this case they are not helping. So, what else I could do to identify that hidden element? Did I miss any point you shared above?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1070389]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2014-09-20 06:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (155 votes), past polls