Do you know where your variables are? | |
PerlMonks |
Re: sequencial file namingby mbond (Beadle) |
on Jun 08, 2001 at 21:14 UTC ( [id://86986]=note: print w/replies, xml ) | Need Help?? |
We do this sort of thing a lot at work for surveys that need to be in text format so the various peopel that want to read them can.
However, we occassional delete files as well that were either tests, or smart-@$$ responces. So to keep track of the files that have been deleted i load the directory, knock off the "." and ".." files and iterate through looking for the first avialable slot. foreach (@files) { if ($_ == $last+1) { open( ... ); } $last = $_; } thats minus error checking, etc .. but its the jist of it. just make sure you check for race conditions (as mentioned above), and iterate to the next one if needed. Mbond.
In Section
Seekers of Perl Wisdom
|
|