If INP1connected to a regular file descriptor (not a socket descriptor or a channel descriptor), you can also seekreturn to the beginning of the file.
while(<INP1>) {
...
}
seek INP1, 0, 0;
while (<INP1>) {
...
}
- , , . , , .
open INP1, '<', $the_file;
@INP1 = <INP1>;
close INP1;
foreach (@INP1) {
...
}
foreach (@INP1) {
...
}