in reply to Re: Parsing data from JSON response file.
in thread Parsing data from JSON response file.
I guess this is "off topic", but a feature of Perl.for my $key ( keys %$data ) { print "key = $key\n"; #debug my $zip = $data->{'zip'}; my $descri = $data->{'happen'}[0]->{'descri'}; my $extra_name = $data->{'notas'}[0]->{'ExtraName'}; print "\n $zip - $descri - $extra_name\n"; }
If you have a constant like: use constant DEBUG => 1; and then have a statement like print "whatever line(s)" if DEBUG;, Perl is smart enough to eliminate this statement from the executable code when DEBUG is false (set to zero). For complex modules, I often leave code like that in the source. When I add a new feature, I turn debugging on. Print is your friend. I seldom need the Perl debugger.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Parsing data from JSON response file.
by roboticus (Chancellor) on Apr 13, 2020 at 17:18 UTC |