John Restaur
New member
I have a while loop in my perl script that pulls a bunch of file names from a directory. There is a part number in each of the file names so I hack off the beginning of the filename and the extension so that I am left with just the part number. I then stick all the part numbers in an array. I want to query my SQL databases with the array but since it's already in a while loop, how would I go about doing this?
My code looks like this:
while (my $file = readdir(DIR)) {
next if ($file =~ m/^\./);
my $filename = substr $file, 4, 6;
my @items = ($filename);
}
Thanks in advance for the help!
My code looks like this:
while (my $file = readdir(DIR)) {
next if ($file =~ m/^\./);
my $filename = substr $file, 4, 6;
my @items = ($filename);
}
Thanks in advance for the help!