|more useful options|
Re^4: trying to identify the exact data stored from dump - [ ' ];by asham (Novice)
|on Jan 13, 2014 at 08:48 UTC||Need Help??|
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?