>  Date: Sat, 11 Aug 2001 13:56:02 -0400
>  From: Rocco Caputo <[EMAIL PROTECTED]>
>
>  On Fri, Aug 10, 2001 at 02:13:07PM -0700, Michael Blakeley wrote:
>  > I have a couple questions about Wheel::ReadLine - probably either very
>  > simple, but I can't seem to find the answers in the docs.
>  >
>  > First, is there a way to refresh the ReadLine prompt whenever put() is
>  > called? For example, if my little HTTP client finishes downloading a page,
>  > it puts a list of links to the ReadLine wheel. I have a ReadLine::get()
>  > posted - can I make its prompt re-appear under the HTTP output? Simply
>  > calling get() again doesn't seem to do it.
>
>  It should do this automatically.  If it's not, please e-mail me a
>  testcase or patch.

How about a FAQ entry instead? I'm sure this is obvious to everyone 
else, but I'm still learning the POE Way.

Q: Why do I lose the ReadLine prompt every time I send output to the screen?

A: Make sure you always use put(), and never use print or printf.

>  > Second, ReadLine appears to insist on using \r\n (newline and carriage
>  > return). This isn't too difficult to arrange most of the time, but it
>  > makes the output from various modules pretty ugly. I could split and join
>  > most of the time (doesn't help with warn from inside other modules,
>  though).
>  > Is there some other approach I should be using? Either changing the
>  > ReadLine behavior, or maybe changing Perl's behavior?
>
>  ReadLine puts the console into raw mode and implements its editing
>  functions internally.  A side effect of the raw console mode seems to
>  be the need to send newlines as "\x0d\x0a" instead of just "\n".
>  Although "\n" might work ok on DOSISH systems where it expands to
>  "\x0d\x0a" internally.
>
>  You probably can tie STDOUT and STDERR to something that fixes the
>  newlines and put()'s the text through the console wheel rather than
>  displaying it directly.  That could rock, actually.  Regular print,
>  warn, and die calls would do the right thing.

Not a bad idea - but for the moment I'll just convert all my prints 
to put(), and use the comma.

thanks,
-- Mike

Reply via email to