Subject: | Term::Prompt messes with $\ in a wierd kind of way |
Date: | Wed, 8 Feb 2017 20:24:25 +0100 |
To: | bug-Term-Prompt [...] rt.cpan.org |
From: | Johan Laenen <johan.laenen [...] gmail.com> |
Hi,
I don't know if this is a bug in Term::Prompt or in the way debian
(and cygwin) package the module, but the following oneliner gives two
lines of output instead of the three I expect to see:
perl -e 'use Text::Wrap; use Term::Prompt qw/prompt/; my $p = prompt(
"y", "", "", ""); { local $\="\n"; print "the quick brown fox" } {
local $\="\n"; print "jumps over the lazy dog." };'
yields:
(y or n) [default n]
the quick brown foxjumps over the lazy dog.
I expected:
(y or n) [default n]
the quick brown fox
jumps over the lazy dog.
Now, this is on debian strech/sid, perl v5.24.1 and Term::Prompt 1.04
(libterm-prompt-perl 1.04-2).
Other perls give different results according to some regulars at #perl
on irc.perl.org, p.e. 5.20.0, 5.20.2, 5.22.0 work as expected. 5.23-5,
5.21.9, 5.21.6 work as I described above with my 5.24.1.
Greetings,
Johan Laenen