Let me know how you convert your additions into a sub.

I'll work on that. I appreciate the concrete Anweisungen

It's just a wrapper around many great modules to implement things like json2perl, perl2yaml with (hopefully correct) unicode suppprt. Don't worry about it. But you can safely replace it with calls to JSON's decode() etc. (which, as stevieb said, switches between XS or PP depending what is installed on your system) so that you have one less dependency.

Ok, it helps to know that PP is the alternative, and PP stands for, wait for it, pure perl.

BTW, I think you also provided me with an answer as to why I never use the debugger :)

I'm happy to provide you with certainty, a rare commodity in this world. :) Like I say, for me it's usually when I'm hooking up parts that are new to me, and I have to figure out what is not happening with values. With hippo's help, I've figured out parts of your debugging scheme, and see how it's built. I wasn't calling it correctly.

>> p @_ 43.61-116.20 >> p $debug 0

I had been passing a bare zero (a hasty stubout) as the third argument to this routine. this was undefined on arrival. Now I have improved it to hook into your debugging scheme, as you define $debug in the caller:

my $return = get_elevation_from_coordinates( $event->{location}->{la +t}, $event->{location}->{lon}, $debug );

Then I get the internals of the exchange with google, and everything makes even more sense:

./6.mp.pl : latitude=-15.6325&longitude=-141&application_max_assets_mt +ime=1559625591 ./6.mp.pl : sending above payload, of 72 bytes... INFO: return from the google is 0 meters

When I hit M in the debugger too see what version of JSON I was running, I was surprised to see that

/usr/local/lib/x86_64-linux-gnu/perl/5.30.0/JSON/XS.pm

was among the loaded modules. I take that to mean that perl is covering its bases for backwards compatibility. I wonder how I might determine whether execution ran through it(?) What's more, I found my PP.pm module, and read it mod 1:

locate  *JSON/PP.pm

, wherein is:

# Note that JSON version 2.0 and above will automatically use # JSON::XS or JSON::PP, so you should be able to just: use JSON;

Again, with the M command, I see that my version is way north of 2.0:

'JSON.pm' => '4.03 from /usr/local/share/perl/5.30.0/JSON.pm' 'JSON/XS.pm' => '4.03 from /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 +/JSON/XS.pm'

So, after all this, I see that it is not of any practical concern for what I do with json. What's more, I would be hesitant to fire a cannon of requests in compiled c to the same server. It might exceed what many consider polite. Love them or hate them, I don't want to be on the wrong side of the google.


In reply to Re^7: a *working* JSON module (Perl's Debugger), related issues by Aldebaran
in thread Can someone please write a *working* JSON module by cnd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.