Great advice on questions 1 and 3, Tanktalus.

I'll look into signals for my first problem (seeing when the configuration file finished being changed).

For the 3rd problem, the remote system is out of my control: I telnet to it without a userid/password and I'm in. The remote system (running VxWorks) offers few commands and immediately dumps stuff, I presume, to stderr. So I was going to use $telnet->getline, but I can't get past $telnet->login because that statement requires username and password.

On the 2nd question, my app is a middleman ... I let people define what logfiles (and search string and optional run-if-match command) to look for and then I generate a single new logfile that must be in a specific format. Another existing app will look at my new logfile and it can grab that data at any time and rotate it out (rename it) into a backup file. That's the reason I'm doing the inefficient open/write/close each time. So I'm not sure how I can use a database since I'm not privy to the app reading my output logfile. I had hoped opening in append mode would not lock it so the other app could grab it, but alas that didn't work. One other less efficient choice is a system call to cat to append things.

UPDATE ON Net::Telnet

Played some more and discovered that the Net::Telnet->new() made the connection to the id-less/psw-less system and I didn't need to do a $telnet->login. Since the remote system is forever dumping data (as far as I was concerned), I planned to looped forever:

my $line; while ($line = $telnet->getline) { print $line; }
But since it dumps data at different times, I ran into a "read timed-out" problem. Is there a way to disable the timeout? Setting to 0 didn't work, so I set it to a high value (one day):
my $line; while ( $line = $telnet->getline(Timeout=>86400000) ) { print $line; }

In reply to Re^2: POE::Wheel questions by shockers
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.