Odd, The buggy behavior is still there in 5.8.3 but does not occur in Perl 5.9.0 (the current development stream, known as "bleadperl"). I don't have an explanation, though, for why it went away and I'm fairly certain there were no explicit attempts to fix this particular problem.
At 7:55 AM +0100 1/19/04, Odd Gripenstam wrote: >>From: "Craig A. Berry" <[EMAIL PROTECTED]> >>At 4:18 AM +0100 1/11/04, Odd Gripenstam wrote: >>>Hi >>> >>>Perl seems to insert extra empty lines when I use -i with -l. >>>I have seen this with 5.8.2 and 5.6.1 (from HP). 5.004_04 does not add the blank >>>lines. >>> >>>Is this a bug or am I doing something wrong? >> >>Hmm. It might be a bug. Can you reproduce this on other platforms, >>or does it only happen on VMS? Does it happen when you do a real >>in-place edit, i.e., when your -e script is more than just ""? >> > >It does not happen on other some other platforms I found: > >This is perl, v5.8.2 built for cygwin-thread-multi-64int >This is perl, v5.6.0 built for sun4-solaris >This is perl, version 5.005_03 built for i386-linux > > >Also happens when the script does something: > >$ perl -lpe "s/line/rad/" test.txt >rad 1 >rad 2 >$ perl -i -lpe "s/line/rad/" test.txt >$ type test.txt >rad 1 > >rad 2 > >$ > >> > >>>$ perl -lpe "" test.txt >>>line 1 >>>line 2 >>>$ perl -i -lpe "" test.txt >>>$ diff test.txt >>>************ >>>File USER:[GRIPENSTAM]TEST.TXT;2 >>> 2 >>> 3 line 2 >>> 4 >>>****** >>>File USER:[GRIPENSTAM]TEST.TXT;1 >>> 2 line 2 >>>************ >>> >>>Number of difference sections found: 1 >>>Number of difference records found: 3 >>> >>>DIFFERENCES /IGNORE=()/MERGED=1- >>> USER:[GRIPENSTAM]TEST.TXT;2- >>> USER:[GRIPENSTAM]TEST.TXT;1 >>>$ >>> >>>A DUMP shows that 0 length records have been added. >> >> >>-- >>________________________________________ >>Craig A. Berry >>mailto:[EMAIL PROTECTED] >> >>"... getting out of a sonnet is much more >> difficult than getting in." >> Brad Leithauser > >_________________________________________________________________ >Add photos to your e-mail with MSN 8. Get 2 months FREE*. >http://join.msn.com/?page=features/featuredemail -- ________________________________________ Craig A. Berry mailto:[EMAIL PROTECTED] "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser
