Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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

by ikegami (Pope)
on Jan 14, 2014 at 17:01 UTC ( #1070576=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 should have done Data::Dumper->Dump($arrayReference) as you said you did, but you really did Data::Dumper->Dump(@$arrayReference). If you want to dump an array or hash, pass a reference to it.

Replies are listed 'Best First'.
Re^4: trying to identify the exact data stored from dump - [ ' ];
by asham (Novice) on Jan 14, 2014 at 18:28 UTC

    Hi, Thanks for looking into this. But unfortunately I am executing with reference only the same as I quoted earlier i.e. Data::Dumper->Dump($arrayReference) .

    Actually even if one were to try Data::Dumper->Dump(@$arrayReference). They would run into usage error and not an output. But since you asked me that. what was your reason for doubting that? there might be some clue for me in your observation.

    Keeping in mind your doubts. I thought would share with you sample usage and let see if you can point out some error in that.

    #!/usr/bin/perl -w use strict; use Data::Dumper; $Data::Dumper::Useqq = 1; my $abc=['cde','bdef','dummy', " \n"]; print (Data::Dumper->Dump($abc) . "\n"); #this will work fine print (Dumper($abc) . "\n"); #this will work fine print (Data::Dumper->Dump(@$abc) . "\n"); # this will give usage error + as I mentioned earlier. 1;

    Note: this is not my real code. just a simple example of how I am using array reference with this module.

    Output: $VAR1 = "cde"; $VAR2 = "bdef"; $VAR3 = "dummy"; $VAR4 = " \n"; $VAR1 = [ "cde", "bdef", "dummy", " \n" ]; Usage: PACKAGE->new(ARRAYREF, [ARRAYREF]) at /tmp/ line 8

    Kindly look into this and let me know if I am missing anything.

    PS: anyway question is

    1) for me why one of the elements(1st element) is not being seen.

    2) what could it possibly be?

    3) and is there any way to identify it?

Re^4: trying to identify the exact data stored from dump - [ ' ];
by asham (Novice) on Jan 16, 2014 at 14:10 UTC

    Thanks for the help everyone. We were able to resolve the issue by serializing the object in that state to avoid anyone manipulating the output file itself. (was needed as it was remotely execute process.)

    We got all the details using that and helped us identify the data.

    thanks again everyone for your valuable time and suggestions.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1070576]
[karlgoethebier]: Good morning
[Discipulus]: good morning vietnam!
[Discipulus]: but there is some perl workshop somewhere? I notice many high level monks disappeared.. we can make PM a squat in the meantime ;=)
[karlgoethebier]: Discipulus: Mmh, who disappeared?
[marto]: morning all
[shmem]: perl -lE '$_="odd mornin";($o=$_)=~ s/^|$/g/g;say$o'

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2017-06-27 08:05 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (600 votes). Check out past polls.