Check for the files the same way you do now, just do it in the loop. Maybe something like:
while ($filehandle = get_next_file()) { ... }
So you spin off your "check if the file exists" and "open the file" code into a new function, and keep doing the loop while there are more files to find.
In reply to Re^7: Poorly written script
by amarquis
in thread Poorly written script
by Baffled
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |