Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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

by asham (Novice)
on Jan 13, 2014 at 08:48 UTC ( #1070394=note: print w/replies, xml ) Need Help??

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

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?

  • Comment on Re^4: trying to identify the exact data stored from dump - [ ' ];

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1070394]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2018-06-25 17:38 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (128 votes). Check out past polls.