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:
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) { print $line; }
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |