in reply to Re: blank lines up to a point
in thread blank lines up to a point
use strict; use warnings; my $firsttime = 1; my $line1 = <DATA>; print neverflop(); $firsttime = 0; my $line2 = <DATA>; print neverflop(); scalar tell(STDIN); print neverflop(); print neverflop(); sub neverflop { ($firsttime .. 0) ? "flip" : "flop"; } __DATA__ line1 line2 line3 __END__ Output: flipflipflipflop
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: blank lines up to a point
by Random_Walk (Prior) on Sep 15, 2004 at 11:09 UTC | |
|
Re^3: blank lines up to a point
by periapt (Hermit) on Sep 15, 2004 at 13:59 UTC | |
by ysth (Canon) on Sep 15, 2004 at 15:00 UTC | |
by SpanishInquisition (Pilgrim) on Sep 15, 2004 at 19:04 UTC |