Thanks a lot for your reply Bob.
but can you be more specific:
You need to either close and reopen the file, or
rewind the file using seek() before you can re-read the data.
I tried seek() following "perldoc" like this:
__BEGIN__
for ( my $t = 1 ; $t <= $trial ; $t++ )
{
for ( $curpos = tell(INFILE); $_ = <INFILE>;
$curpos = tell(INFILE))
{ print "Trial ", $t, "\n";
while (<INFILE>) {
print;}
}
seek(INFILE, $curpos, 0);
}
but doesn't seem to work.
Also tried to close and 'reopen'.
Doesn't seem to work as well.
__BEGIN__
for ( my $t = 1 ; $t <= $trial ; $t++ )
{
print "Trial ", $t, "\n";
while (<INFILE>) {
print;}
}
close INFILE;
open INFILE; #is this how you reopen?
__END__
Hope you don't mind to elaborating it.
Thanks again.
Regards
Edward WIJAYA
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>