X-Scanned-BY: | AMaViS-ng at bestpractical |
MIME-Version: | 1.0 |
X-Spam-Status: | No, hits=-2.6 required=8.0 tests=BAYES_00 |
Content-Disposition: | inline |
Received-SPF: | pass (x1.develooper.com: local policy) |
content-type: | text/plain; charset="utf-8" |
Received: | from localhost (localhost.localdomain [127.0.0.1]) by diesel.bestpractical.com (Postfix) with ESMTP id AFEC44D863C for <cpan-bug+io-prompt@diesel.bestpractical.com>; Fri, 31 Mar 2006 08:13:00 -0500 (EST) |
Received: | from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 4A50E4D8141 for <bug-io-prompt@rt.cpan.org>; Fri, 31 Mar 2006 08:13:00 -0500 (EST) |
Received: | (qmail 31822 invoked by alias); 31 Mar 2006 13:12:54 -0000 |
Received: | from bluebeard.laxan.co.uk (HELO bluebeard.laxan.co.uk) (81.21.79.10) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 31 Mar 2006 05:12:48 -0800 |
Received: | from smylers by bluebeard.laxan.co.uk with local (Exim 3.36 #1 (Debian)) id 1FPJQf-0001Ja-00 for <bug-io-prompt@rt.cpan.org>; Fri, 31 Mar 2006 14:12:41 +0100 |
Delivered-To: | cpan-bug+io-prompt@diesel.bestpractical.com |
Subject: | Unwarranted Presumption About $\ |
User-Agent: | Mutt/1.5.9i |
Return-Path: | <Smylers@stripey.com> |
X-Original-To: | cpan-bug+io-prompt@diesel.bestpractical.com |
X-Spam-Check-BY: | la.mx.develooper.com |
Date: | Fri, 31 Mar 2006 14:12:41 +0100 |
Message-Id: | <20060331131240.GA3660@stripey.com> |
To: | bug-io-prompt@rt.cpan.org |
From: | Smylers <Smylers@stripey.com> |
X-RT-Original-Encoding: | us-ascii |
Content-Length: | 965 |
Hi there. Thanks for IO::Prompt -- it looks like a really useful
module.
I've spotted a bug which while small did trip me up the very first time
I tried out this module after installing it:
% perl -MIO::Prompt -wle '$t = prompt "What? "; print "[$t]"'
The text entered by the user is rather confusingly displayed only one
character per line, so it goes down the screen rather than across.
The culprit is the -l option, which is setting $\ to "\n" -- which is
exactly what I wanted in the print statement in the line above, but
which is also affecting print inside the prompt function.
The fix is simple; just add this line:
local $\ = '';
I put it just before the print statement on line 446 (in version
0.99.4):
print {$OUT}(defined $echo ? $echo : $next);
But it may be that there are other print statements in IO::Prompt
affected by this, and $\ should actually be set in a wider scope.
Best wishes, and thank you again for the module.
Smylers