Quite some time ago, writting into several diffrent files from a function which opened each time, i had a problem were data would not fluch correctly. My only guess at the time was that the implicit close on my version of Perl was not flushing to disk. Not sure this is the correct cause, but adding the single close line fixed it, so i always explicitly close filehandles ... just a warning.
OH, a sarcasm detector, that’s really useful | [reply] [d/l] [select] |
The 'extra' close allows for error checking as well, that's why it's a good idea to keep it - of course only if you really check for errors ;)
close FILE or die "Couldn't close file: $!";
If you nevertheless want the continous counting of lines a la $. it shouldn't be a problem to do that yourself with something like $linecount++
-- Hofmator
| [reply] [d/l] [select] |