Questions tagged [data-dumper]

Data::Dumper is a Perl library for generating stringified representations of data structures, suitable for both printing and eval.

Data::Dumper is a Perl library for generating stringified representations of data structures, suitable for both printing and eval.

92 questions
0
votes
1 answer

Perl - Accessing data from decode_json output

I supply my script with a file of JSON data. I have then decoded the JSON data using decode_json... open my $fh, '<:encoding(UTF-8)', $file ir die; my $jsondata = do {local $/; <$fh> }; my $data = decode_json($jsondata); #print Dumper…
yonetpkbji
  • 1,019
  • 2
  • 21
  • 35
0
votes
2 answers

Spliting letters from an input into an array in perl

I'm working on a project where I need to take an input from the user and then cut it up into its individual characters for later use (to shift them up one character) but I'm having trouble getting the input into an array and printing it out to check…
masral
  • 69
  • 5
0
votes
1 answer

Unexpected with Boolean when data dumper JSON

My perl code: #!/usr/bin/perl if ( not -f "$ARGV[0]" ) { die "$!"; } open(DATA,"$ARGV[0]") || die "$!"; $data = ; close(DATA); use JSON qw(decode_json); $tidy = decode_json($data); use Data::Dumper; $Data::Dumper::Terse =…
Boontawee Home
  • 935
  • 7
  • 15
0
votes
1 answer

Symfony VarDumper Doctrine Sub Objects

When i use VarDumper of Symfony (symfony/var-dumper) to dump an Doctrine object and do have collection of subobject but the dumper dont display those sub-objects ? Is it normal ? I use : echo '
';
   …
psylo66
  • 608
  • 11
  • 26
0
votes
2 answers

Issue accessing Hash in perl

I have a Hash of following structure in perl - my %testHash = ( KeyL1 => { KeyLL1 => { KeyLLL1 => [1,2], KeyLLL2 => [2,3], }, KeyLL2 => { KeyLLL1 => [1,2], …
dipamchang
  • 77
  • 1
  • 8
0
votes
2 answers

Understanding Data::Dumper output

Simple question: use warnings; use XML::Simple; use Data::Dumper; my $file='test.osm'; my $test_data = XMLin( $file ); print Dumper( $test_data ); my @way_node_refs=$test_data->{'way'}->{'nd'}; print Dumper( @way_node_refs ); print(…
mad_a_i
  • 23
  • 1
  • 5
0
votes
1 answer

Print data after dumper

I have this structure with data-dumper: $VAR1 = { 'field' => [ { 'content' => { 'en' => [ 'Footware haberdashery leather goods' …
Python_96
  • 45
  • 9
0
votes
3 answers

How to get a value from deep within a hash in perl

I'm reading in an xml file, $myxml = XMLin("$configfile"); And when I print it using Dumper (print Dumper($myxml);) I get this... $VAR1 = { 'Timeout' => 5, 'Roots' => { 'Root' => [ …
John
  • 787
  • 4
  • 11
  • 28
0
votes
2 answers

Iterating through an array of hashes

I have wrote the below routine, to iterate through hashes 0 - 7 and print out the value of a specific key in each. I need to grab the value of 'b4' in each hash. I would like to do away with the (0..7), with something smarter for when there are…
lollan
  • 71
  • 5
0
votes
1 answer

Obtaining a value from a nested hash/array data structure

I am doing some API queries using Perl and using Data::Dumper to print the contents and hopefully assign several keys as variables. $client->request( "GET", "interfaces/detail", $opts ); my $out = decode_json $client->responseContent(); …
lollan
  • 71
  • 5
0
votes
1 answer

How to get "Var1" value of dumper in perl

When i use below code then it gives output, But i want "width", "file_media_type", "file_ext" values, But I am unable to get this value in individual. I am very new with Perl Please help me! Code use warnings ; use strict; use Image::Info…
Nikhil Ranjan
  • 138
  • 11
0
votes
3 answers

How to get line numbers when warning with Data::Dumper result?

warn behaves differently in the following two cases: #! /usr/bin/perl use warnings; use strict; use Data::Dumper; warn "string"; warn Dumper("string"); The first prints: string at dumper.pl line 6. And the second prints just: $VAR1 =…
ceving
  • 21,900
  • 13
  • 104
  • 178
0
votes
0 answers

How to check whether Data::Dumper is installed?

I am new to Perl. I have a Perl script which uses the Data::Dumper module. But on some systems the module isn't installed. So I need to check whether Data::Dumper is installed or not. How can I do that?
avishkar
  • 19
  • 1
  • 2
0
votes
3 answers

Access Data Dumper nested Perl Hash

I have a Perl hash reference $artifact that I am printing using Data::Dumper. The output of print Dumper ($artifact); returns the following. $VAR1 = bless( { '_content' => '{ "results" : [ { "uri" : "http://localhost:port/myfile.tar" …
user2402135
  • 371
  • 1
  • 6
  • 19
0
votes
2 answers

Perl - Printing elements within a hash structure

I have a huge, huge, huge data structure, exactly in the format as shown below from Data::Dumper (though greatly simplified for the purposes of explaining the problem). { Fred => { "Street Name" => ["First Avenue"], …
yonetpkbji
  • 1,019
  • 2
  • 21
  • 35