Permalink
Browse files

Supply a B38400 symbol if the local version of POSIX.pm won't.

  • Loading branch information...
1 parent a96e6ee commit 7d78700de5c8b153e10d9cbb4991c82a306d185f @rcaputo committed Sep 16, 2003
Showing with 8 additions and 3 deletions.
  1. +8 −3 lib/POE/Wheel/ReadLine.pm
@@ -9,7 +9,7 @@ $VERSION = (qw($Revision$ ))[1];
use Carp;
use Symbol qw(gensym);
use POE qw(Wheel);
-use POSIX qw(B38400);
+use POSIX;
# Things we'll need to interact with the terminal.
use Term::Cap;
@@ -85,12 +85,17 @@ for (my $ord = 0; $ord < 256; $ord++) {
# Gather information about the user's terminal. This just keeps
# getting uglier.
+# Some platforms don't define this constant.
+unless (defined \&POSIX::B38400) {
+ eval "sub POSIX::B38400 () { 0 }";
+}
+
# Get the terminal speed for Term::Cap.
-my $ospeed = B38400;
+my $ospeed = POSIX::B38400();
eval {
my $termios = POSIX::Termios->new();
$termios->getattr();
- $ospeed = $termios->getospeed() || B38400;
+ $ospeed = $termios->getospeed() || POSIX::B38400();
};
# Get the current terminal's capabilities.

0 comments on commit 7d78700

Please sign in to comment.