Normally, most programs that allow reload of configurations have a SIGHUP signal handler (or SIGUSR1) which causes the reload. The reason for this is simple: you don't want to reload an incomplete file - if the sysadmin is in the middle of saving when you notice the file changed, you could interrupt the save process, read half a file, and get something that didn't make sense. Or maybe the sysadmin was saving progress as they went because they were worried about losing changes - e.g., working via dial-up, and worried that their connection would drop at any minute now that their teenaged daughter just got home from school and would mindlessly pick up the phone to call her friends who she just left not more then 20 minutes ago at school, but had to call them right now! In that case, you don't want to pick up the changes until the user explicitly told you to. And the popular way, as I said, is to run "kill 1 `cat /var/pid/yourprogram.pid`". Or something to similar effect. (1 is SIGHUP on most systems.)

Efficient means you need to keep the filehandle open - opening for append on each line can get expensive for large files. More efficient may be to log to a database and let the database handle the conflicts.

Final question: yes - you could telnet in via Net::Telnet and do whatever you want with the incoming data.


In reply to Re: POE::Wheel questions by Tanktalus
in thread POE::Wheel questions by shockers

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.