[5621] in testers

home help back first fref pref prev next nref lref last post

Re: perl sort of bug

daemon@ATHENA.MIT.EDU (Greg Hudson)
Sat Jul 5 11:30:53 2003

From: Greg Hudson <ghudson@MIT.EDU>
To: Laura Baldwin <boojum@mit.edu>
Cc: testers@mit.edu
In-Reply-To: <200307051414.h65EEOww023565@geskekelud.mit.edu>
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Message-Id: <1057419050.12524.556.camel@error-messages.mit.edu>
Mime-Version: 1.0
Date: 05 Jul 2003 11:30:50 -0400

On Sat, 2003-07-05 at 10:14, Laura Baldwin wrote:
> I have some perl scripts which (apparently wrongly) used \% to print a
> percent sign.  (This only seems to work if followed by a |, but it
> was.)

The string literals "%" and "\%" produce the same string.  Without
fundamentally changing the way the language works, printf can't behave
differently on one or the other.

So the real behavior change is in what "% |" and "%\n" do.  It's a
little weird that the new code consumes an argument before giving up and
printing "%", but it has every right to do something weird on invalid
input like that.


home help back first fref pref prev next nref lref last post