http://qs321.pair.com?node_id=282633


in reply to An introduction to POE

I'm having trouble getting this sample POE code to work under Win32 (XP) with Activestate Perl 5.8.0. I have installed the POE, TermReadKey, and Term-Cap modules. Here is the error I get:
>perl poetest.pl Your vendor has not defined POSIX macro B38400, used at D:/Perl/site/l +ib/POE/Whe el/ReadLine.pm line 89 Compilation failed in require at (eval 31) line 1. BEGIN failed--compilation aborted at (eval 31) line 1. could not import qw(Wheel::ReadLine) at poetest.pl line 5 BEGIN failed--compilation aborted at poetest.pl line 5. E:\Documents and Settings\vijay\test>perl -v
Seems like I may need to install Cygwin. But I'm curious as to what this macro at line 89 is, and if there is a workaround for Win32 - here is the relevant code from the ReadLine.pm module:
Line 12: use POSIX qw(B38400); Line 88: # Get the terminal speed for Term::Cap. my $ospeed = B38400;

Replies are listed 'Best First'.
Re: Re: An introduction to POE
by rcaputo (Chaplain) on Aug 28, 2003 at 06:26 UTC
    Seems like I may need to install Cygwin. But I'm curious as to what this macro at line 89 is, and if there is a workaround for Win32

    The B38400 constant is exported by the standard POSIX module. It represents 38400 baud terminal rates, the fastest available under POSIX. Windows doesn't use standard terminals, so B38400 is useless in ActivePerl. Unfortunately, ActivePerl doesn't support B38400 with a dummy value, so code relying on it breaks there.

    The problem is easy enough to work around if the author knows about it. Just check $^O eq 'MSWin32' and either avoid B38400 altogether or define a dummy version of it so the code continues on.

    Check rt.cpan.org for an effective way to report bugs in CPAN distributions.

    -- Rocco Caputo - rcaputo@pobox.com - poe.perl.org