Good idea. That is actually one of the first things I did when running the code. And then came the realization that $key wasn't used anywhere within the loop!
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";
}
I guess this is "off topic", but a feature of Perl.
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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|