Ok then, I don't think there's a whole lot you can do to improve a script this simple. There are some other places where you can put long concatenations into single double-quoted strings like I showed before, which (in my opinion, anyway) is clearer. You might also add some error checking to your DBI executes, dying/warning with $DBI::errstr if something goes wrong.

On the subject of efficiency: in my experience, when you're fetching data from sites across the net, your script will almost always spend most of its time waiting for that data. Unless your database server is particularly overworked, your database lookup and updates won't take much time, so while there may be things you could do to speed them up (like indexes), it probably wouldn't affect the overall speed of your script significantly. If the API fetches can be sped up, that would have to be done within the module, not your script. You could speed things by forking/threading to do multiple fetches at once, but that might violate the API's rules.

So for the most part, I'd say your script is fine. I'd make some style changes, but those are fairly subjective, and I doubt much can be done regarding efficiency.

Aaron B.
Available for small or large Perl jobs; see my home node.


In reply to Re^3: Google MapsAPI by aaron_baugher
in thread Google MapsAPI by drodinthe559

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.