Hello, I am using POE::Component::IRC for my IRC bot.
I have written a script using File::Tail to print a log file in real-time. The script works fine as a separate script but when I add this script into my IRC bot it causes it to lock up and ping out. I'm assuming It's a buffer issue. I've tried setting $| = 1; and I tried changing the while loop to an if loop like in the POE cookbook so it looked like this:
sub outputlog {
if ($switch == 1) {
sleep 3;
print "test";
outputlog->();
}
}
But no matter what I try even to do a basic loop like above it causes the bot to freeze and ping out. Anyone have any insight on how to make an infinite loop unbuffered in POE?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|