use strict; use warnings; my $firsttime = 1; my $line1 = <DATA>; print neverflop(); $firsttime = 0; my $line2 = <DATA>; print neverflop(); #scalar tell(STDIN); $. = 0; print neverflop(); print neverflop(); sub neverflop { my $statecount = ($firsttime .. 0); ($firsttime .. 0) ? "flip$statecount\t" : "flop$statecount\t"; } __DATA__ line1 line2 line3 __END__ flip1 flip2 flip3E0 flop
In reply to Re^3: blank lines up to a point
by periapt
in thread blank lines up to a point
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |