in reply to Re^2: Reading a text file collapsing line continuations
in thread Reading a text file collapsing line continuations
#!/usr/bin/perl -w use strict; use warnings; while (defined(my $line = <DATA>) ) { print $line; redo; } __DATA__ 1
Update: Better example code (I think). Prints 210 under Windows and 2 under Linux:
#!/usr/bin/perl use strict; use warnings; my $j = 2; while ( my $i = $j ) { print $i if defined $i; last unless $i--; redo; }
Update 2: Filed a bug report, id [perl #63752]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Reading a text file collapsing line continuations
by CountZero (Bishop) on Mar 09, 2009 at 19:28 UTC | |
|
Re^4: Reading a text file collapsing line continuations
by kennethk (Abbot) on Mar 12, 2009 at 15:57 UTC |