Skip Menu |

This queue is for tickets about the POE CPAN distribution.

Report information
The Basics
Id: 20159
Status: resolved
Priority: 0/
Queue: POE

People
Owner: Nobody in particular
Requestors: ang [...] nmc-m.dtag.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject:
Date: Wed, 28 Jun 2006 12:38:55 +0200
To: <bug-POE [...] rt.cpan.org>
From: "Angerstein" <ang [...] nmc-m.dtag.de>
Please see the attached Emails

Message body is not shown because sender requested not to inline it.

Subject: Issue with POE::Wheel::ReadLine
Date: Tue, 27 Jun 2006 14:20:08 +0200
To: <poe [...] perl.org>
From: "Angerstein" <ang [...] nmc-m.dtag.de>
Hello there, I have a Problem with the ReadLine Wheel both on my Windows and my Unix Box. On Windows: Your vendor has not defined POSIX macro B38400, used at C:/perl/site/lib/POE/Whe el/ReadLine.pm line 700 (in cleanup) Can't call method "Tputs" on an undefined value at C:/perl/ site/lib/POE/Wheel/ReadLine.pm line 911. On Unix: Failed termcap lookup on dtterm at .../ReadLine.pm line 709 (in cleanup). Can´t call methode "Tputs" on an undefined value at ../ReadLine.pm Line 911. I added the code at the end of the Mail. Any ideas? Thx Bastian The Code: use strict; #use warnings; use POE qw( Wheel::ReadLine ); POE::Session->create( inline_states => { _start => \&sys_start, word => \&word, input => \&input, _stop => \&sys_exit, }, ); $poe_kernel->run(); sub sys_start { my $kernel = $_[KERNEL]; print "Just Starting Up\n"; $kernel->yield( 'word' ); print "sys_start fertig!\n"; } sub word { my $kernel = $_[KERNEL]; my $session = $_[SESSION]; my $heap = $_[HEAP]; my @args = @_[ARG0..ARG9]; print "Starte Word!\n"; $heap->{read} = POE::Wheel::ReadLine->new( InputEvent => 'input', appname => 'mycli' ); $heap->{read}->get( 'Prompt: ' ); print "Word fertig!\n" } sub input { #echo input my ($heap, $input, $exception) = @_[HEAP, ARG0, ARG1]; if (defined $input) { $heap->{read}->addhistory($input); $heap->{read}->put("Got: $input"); $heap->{read}->get('Prompt: '); } else { $heap->{read}->put("Exception: $exception"); } $heap->{read}->clear(); }

Message body is not shown because sender requested not to inline it.

Subject: AW: Issue with POE::Wheel::ReadLine
Date: Tue, 27 Jun 2006 14:44:04 +0200
To: "'Angerstein'" <ang [...] nmc-m.dtag.de>
From: "Angerstein" <ang [...] nmc-m.dtag.de>
Should do the same as: sub word { my $kernel = $_[KERNEL]; my $session = $_[SESSION]; my $heap = $_[HEAP]; my @args = @_[ARG0..ARG9]; my $input = <STDIN>; $kernel->yield( 'input', $input ); } sub input { #echo input my ($heap, $kernel, $input) = @_[HEAP, KERNEL, ARG0]; if (defined $input) { print $input; undef ($input); } else { $input = <STDIN>; } $kernel->yield( 'input', $input ); } Show quoted text
-----Ursprüngliche Nachricht----- Von: Angerstein [mailto:ang@nmc-m.dtag.de] Gesendet: Dienstag, 27. Juni 2006 14:20 An: poe@perl.org Betreff: Issue with POE::Wheel::ReadLine Hello there, I have a Problem with the ReadLine Wheel both on my Windows and my Unix Box. On Windows: Your vendor has not defined POSIX macro B38400, used at C:/perl/site/lib/POE/Whe el/ReadLine.pm line 700 (in cleanup) Can't call method "Tputs" on an undefined value at C:/perl/ site/lib/POE/Wheel/ReadLine.pm line 911. On Unix: Failed termcap lookup on dtterm at .../ReadLine.pm line 709 (in cleanup). Can´t call methode "Tputs" on an undefined value at ../ReadLine.pm Line 911. I added the code at the end of the Mail. Any ideas? Thx Bastian The Code: use strict; #use warnings; use POE qw( Wheel::ReadLine ); POE::Session->create( inline_states => { _start => \&sys_start, word => \&word, input => \&input, _stop => \&sys_exit, }, ); $poe_kernel->run(); sub sys_start { my $kernel = $_[KERNEL]; print "Just Starting Up\n"; $kernel->yield( 'word' ); print "sys_start fertig!\n"; } sub word { my $kernel = $_[KERNEL]; my $session = $_[SESSION]; my $heap = $_[HEAP]; my @args = @_[ARG0..ARG9]; print "Starte Word!\n"; $heap->{read} = POE::Wheel::ReadLine->new( InputEvent => 'input', appname => 'mycli' ); $heap->{read}->get( 'Prompt: ' ); print "Word fertig!\n" } sub input { #echo input my ($heap, $input, $exception) = @_[HEAP, ARG0, ARG1]; if (defined $input) { $heap->{read}->addhistory($input); $heap->{read}->put("Got: $input"); $heap->{read}->get('Prompt: '); } else { $heap->{read}->put("Exception: $exception"); } $heap->{read}->clear(); }
Wheel::ReadLine won't be very helpful on Windows. ActiveState Perl can only multiplex sockets, and your console isn't one. Nevertheless, I've corrected the B38400 error... and added an explicit die() if you're using Wheel::ReadLine in MSWin32. Thanks for the bug report.