Did $heap->{wheel}->get( "prompt:" ); not work for you?

It's documented.

David


On 5 Feb 2007 13:35:13 -0800, Paul Miller <[EMAIL PROTECTED]> wrote:

I'm using POE::Wheel::Run successfully and there's a situation where
my prompt should change dynamically.  I couldn't find a way to do it
directly, but using the source I created this mess:

sub change_prompt {
    my $heap = $_[HEAP];
    my $arg0 = $_[ARG0];

    EVIL_HACK: {
        local $| = 1; print "\r", " " x (length $heap->{prompt}),
"\r";

        $heap->{prompt} = $arg0;
        $heap->{wheel}->[ $heap->{wheel}->SELF_PROMPT ] = $arg0;
        $heap->{wheel}->_repaint_input_line;
    }
}

First of all, is there a better, less internally hacky way to do
this?  Second, if not, given that it seems like such a natural thing
to want to do; why isn't it already in there somewhere?


Reply via email to