develooper Front page | perl.perl5.porters | Postings from January 2001

Bug with -p in 5.6, 5.7

From:
Ben Tilly
Date:
January 11, 2001 18:06
Subject:
Bug with -p in 5.6, 5.7
Message ID:
LAW2-F89W4QwSpxuxpl00021e1b@hotmail.com
The following one-liner for adding returns at the
beginning of each file adds an extra return at the end
with 5.6 and 5.7.  Tested in 5.6.0 on Linux, and with a
fairly recent snapshot also on Linux.

Tested and found working in 5.005_03 on both Linux and
Windows.

perl -pi.bak -e 'BEGIN{undef($/)} s//\n/' foo*

The following code which should be equivalent does not
show the bug for me in a recent snapshot but it DOES on
5.6.0:

perl -i.bak -e 'BEGIN{undef($/)} while (<>) {s//\n/; print;}' foo*

My guess is that this is a bug that was fixed in one place
but needs to be fixed in 2?

Cheers,
Ben

PS I have a report that neither bug showed up in
ActiveState's binary build 618.  The 5.6 tests were
consistent on 2 different machines.

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About