I am trying to compare files names listed in a file to the actual files
in a directory.  My code is as follows:

 

Opendir(DIR,"name");

@files=readdir(DIR);

 

 Open(IN,"<fileList");

 

While(<IN>) {

            If(/^pattern/) {

                        moveFile($_);

            }

}

 

Close(IN);

 

Sub moveFile() {

            My [EMAIL PROTECTED];

            Foreach(@files) {

                        If(/$src/) {

                                    Print "$_\n";

                        }

            }

}

 

 

I know this is not the most efficient, but I do not understand why the
statement if(/$src/) is never true?  Does not seem the $src is
interpolated correctly for the match.

Why is this happening?  How can it be fixed?

 

Thanks in advance!!!

 

Jim

Reply via email to