The module can already download, parse and compare the old and new data to determine if there's an update. I can lose the DATA section and have the module install the data ~/.somewhere but that should be a place that is accessible to all users in any scenario (system, perlbrew, etc) who may run the module in a cross platform compliant manner; and that the module can write to. Is there even such a place?

It seems reasonable until I realized that checking for updated modules is probably not a very common activity among casual users of software. I could make the module expire by failing to run after a certain date, but that seems more evil than providing the (slightly) wrong data.

I was thinking about one way to do it, by invoking the module from the folder one wants the new data to reside, and then telling the module about it like:

[user@to] perl -MMy::Mod=:all -e 'update()' [user@to] Update detected! File saved to /path/to/data [user@to] perl -MMy::Mod=:all -e 'foobar(data=>"/path/to/data");baz()'
That would work but I don't like it because scripts and such would have to be changed too. It would be better if the module installed the data to some standard place and simply updated the data file:
[user@to] perl -MMy::Mod=:all -e 'update()' [user@to] Update detected! Using new data...
Or better make the module remember things and check once a month or so:
[user@to] perl -MMy::Mod=:all -e 'foobar();baz()' [user@to] Update detected! Using new data...
As you did intuit, it was a bad idea that inspired the OP node. ⛐

Thanks for helping!


In reply to Re^6: Do modules know the callers full path? by Anonymous Monk
in thread Do modules know the callers full path? by Anonymous Monk

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.