Hi,
I am not able to get the correct values when I am running this script below. Basically I am putting writing everything in an array into a file 'file.txt'. Then foreach line in the file I am trying to find the file in the directory /home/omar
open (DAT, "file.txt");
@newFiles = <DAT>;
foreach $newfile (@newFiles)
{
chomp $newfile;
my $smsdir = "/home/omar";
print "$newfile\n";
if ( glob ("$smsdir/*/*_$newfile*"))
{
$type = "YES";
}
else
{
$type = "NO";
}
print "$type\n";
I am getting some of the results correct and some false. Does anyone know what the problem is?
Omar.
I am not able to get the correct values when I am running this script below. Basically I am putting writing everything in an array into a file 'file.txt'. Then foreach line in the file I am trying to find the file in the directory /home/omar
open (DAT, "file.txt");
@newFiles = <DAT>;
foreach $newfile (@newFiles)
{
chomp $newfile;
my $smsdir = "/home/omar";
print "$newfile\n";
if ( glob ("$smsdir/*/*_$newfile*"))
{
$type = "YES";
}
else
{
$type = "NO";
}
print "$type\n";
I am getting some of the results correct and some false. Does anyone know what the problem is?
Omar.