If you want to loop through your entire file 5 times, then you can use seek to get back to the start of the file, then put everything inside another loop:
open my $fh,"+<four_comma.txt" or die "Cannot open text $!"; my $i=0; for (1..5) { while(<$fh>){ say $_; say ++$i; } seek $fh, 0, 0; }
In reply to Re: loop by line on a file
by nevdka
in thread loop by line on a file
by sage.erosenin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |