Like this ...
for ( ; my $in = <$fh> ; ) { ... } # or ... for ( ;; ) { last if eof $fh; my $in = <$fh>; ... }
... ? The first case is very much like while with the additions of empty initialization & increment statements both of which happened to be covered by the loop end condition. So all you gain is obfuscation with for loop in this case.
In reply to Re^2: Print in TXT (while loop)
by parv
in thread Print in TXT (while loop)
by marto9
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |