Sorry if you get this message twice, but I don't think it made it out the first time.

I was following the thread glob vs. readdir and changed one of my scripts to readdir:

            # Clean-up the job/coop's directories.
            foreach $ForVar1 ("ctr","e??","frm","fmx","i??","lgo")
            {
                unless (chdir("$RootDir/$Coop/$JobName/$CoopDir/")) {next;}
                opendir(GLOB,".") or die "Cannot open current directory $!, stopped";
                @Result = grep /\.$ForVar1/, readdir(GLOB);
                closedir(GLOB);
                if (@Result)
                {
                    foreach $ForVar2 (@Result)
                    {
                        del("!q $ForVar2");
                    }
                }
            }

I am having a problem with the grep function. It returns all of the files in the 
directory instead of the specified file extensions.
It appears that grep does not recognize the value in $ForVar1. Any suggestions?

Dirk Bremer - Systems Programmer II - AMS Department - NISC
636-922-9158 ext. 652 fax 636-447-4471

<mailto:[EMAIL PROTECTED]>


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to