Hi,
I was wondering could anybody show me how i would open a number of files from a directory.Each file begins with qfh and then a series of different numbers and letters. My code below prints out the specified files but i need to open them to search for a certain word. Can you help me please.
opendir(DIR, "/var/spool/mqueue"
@files = readdir(DIR);
foreach $file (@files)
{
if($file =~ /qfh[0-9a-z]/)
{
print "$file\n";
}
}
closedir(DIR)
I was wondering could anybody show me how i would open a number of files from a directory.Each file begins with qfh and then a series of different numbers and letters. My code below prints out the specified files but i need to open them to search for a certain word. Can you help me please.
opendir(DIR, "/var/spool/mqueue"
@files = readdir(DIR);
foreach $file (@files)
{
if($file =~ /qfh[0-9a-z]/)
{
print "$file\n";
}
}
closedir(DIR)