Subject: | constant CC_FIELDS error with Perl 5.9.x |
Hi!
Something in "use constant" has changed since Perl 5.9.3
which breaks the way it is used in Term::ReadPassword.
The attached patch fixes it by using a real variable
instead of a constant.
I'm anyway not sure I understood this termios stuff right,
e.g. I also have problems using the constant NCCS, for which
POSIX::Termios complains in getcc calls. The patch does not
include a fix to this as I'm not sure. Although I personally
had to remove the constant NCCS from the CC_FIELDS array locally
on my machine.
I hope you have tuits to fix that, else feel free to ask for
co-maintainership.
Thanks for your module.
Greetings from Dresden,
Steffen
--
Steffen Schwigon <schwigon@webit.de>
Dresden Perl Mongers <http://dresden-pm.org/>
Deutscher Perl-Workshop <http://www.perl-workshop.de/>
Subject: | constant_5.9_fix.patch |
--- ReadPassword.pm 2005-10-25 20:56:02.000000000 +0200
+++ ../ReadPassword.pm 2007-08-07 14:18:23.000000000 +0200
@@ -3,16 +3,17 @@
use strict;
use Term::ReadLine;
use POSIX qw(:termios_h);
- use constant CC_FIELDS =>
- (VEOF VEOL VERASE VINTR VKILL VQUIT
- VSUSP VSTART VSTOP VMIN VTIME NCCS);
use vars qw(
- $VERSION @ISA @EXPORT @EXPORT_OK
+ $VERSION @ISA @EXPORT @EXPORT_OK @CC_FIELDS
$ALLOW_STDIN %SPECIAL $SUPPRESS_NEWLINE $INPUT_LIMIT
$USE_STARS $STAR_STRING $UNSTAR_STRING
);
+@CC_FIELDS =
+ (VEOF, VEOL, VERASE, VINTR, VKILL, VQUIT,
+ VSUSP, VSTART, VSTOP, VMIN, VTIME, NCCS);
+
require Exporter;
@ISA = qw(Exporter);
@@ -74,7 +75,7 @@
my $term = POSIX::Termios->new();
$term->getattr($fd_tty);
my $original_flags = $term->getlflag();
- my %original_cc = map +($_, $term->getcc($_)), CC_FIELDS;
+ my %original_cc = map +($_, $term->getcc($_)), @CC_FIELDS;
# What makes this setup different from the ordinary?
# No keyboard-generated signals, no echoing, no canonical input