in reply to Re^5: Do modules know the callers full path?
in thread Do modules know the callers full path?
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:
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! File saved to /path/to/data [user@to] perl -MMy::Mod=:all -e 'foobar(data=>"/path/to/data");baz()'
Or better make the module remember things and check once a month or so:[user@to] perl -MMy::Mod=:all -e 'update()' [user@to] Update detected! Using new data...
As you did intuit, it was a bad idea that inspired the OP node. ⛐[user@to] perl -MMy::Mod=:all -e 'foobar();baz()' [user@to] Update detected! Using new data...
Thanks for helping!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Do modules know the callers full path?
by soonix (Chancellor) on Feb 18, 2023 at 16:03 UTC |