In short... TMTOWTDI ;-)
If your program is for example waiting for some input (realtime log parsing?) then you can use it as a trigger (with counter or time interval check) that fetches with LWP required files (some data your script needs by itself) and rewrite the disk file. Then just gently close all open descriptors and try exec() or even exit() (if your script would start again automagically ;-p).
Another way - fork, sleep and send kill signal to the second process, it has to serve it with fetching with LWP, and so on... But remeber - $SIG{anything} routines should be as short as possible!
You can also write another program that only fetches those files and send SIGUSRn to your script (and then it should (re)load those files)...
I prefer to use 'at start' method - just chceck for a new version at startup. Just K.I.S.S. Simple solutions are the best solutions (IMHO) - even if it sometimes means to have a bunch of small scripts that work together ;-)

Greetz, Tom.

In reply to Re: Remote File Updating by tmiklas
in thread Remote File Updating 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.