Soldato
- Joined
- 5 Dec 2003
- Posts
- 2,716
- Location
- Glasgow
Hi, I have about 10,000 directories to go through and I want to put into a database which ones contain any files with, for example, an .mp3 extension.
So far I have a for loop going through each directory and have tried something like this:
$fileExtension = glob(*.mp3);
if (defined ($fileExtension)) {
gotExtension = true;
}
#update DB here
which doesn't work but something like that would be my ideal way to do it and I don't think I'm too far off, maybe a problem with the glob and regex if anyone can help?
So far I have a for loop going through each directory and have tried something like this:
$fileExtension = glob(*.mp3);
if (defined ($fileExtension)) {
gotExtension = true;
}
#update DB here
which doesn't work but something like that would be my ideal way to do it and I don't think I'm too far off, maybe a problem with the glob and regex if anyone can help?