in reply to How to delet the actual readed line from a file?

Hi ,

Pls correct me if I'm wrong, but it strikes me that, by inference, the application must have persistence to some degree, hence maybe something like this might better fit the bill (apologies in advance for untested code)...

# Slurp file in one - assuming there's room:-) open FILE, "<fname" or die "open() - $!"; local undef $/; @files = <FILE> close FILE; while (@files) { # # do something with file $_ # shift @files; } END { # Save any state @files && do { open FILE, ">fname" or die "Cannot save state - $!"; printf FILE "@files"; close FILE; }; }
HTH , Rgds ,

A user level that continues to overstate my experience :-))