Home > other >  Perl, File: : Find how to match the File name. Can't match with the variable change the File na
Perl, File: : Find how to match the File name. Can't match with the variable change the File na

Time:09-28

Everyone a great god, and I want to do is to find the filename, directory and to the operation of the document classification,
Use File: : Find;
Use File: : Copy;

My $dir="E: \ \ perl_stduy";
My $tardir="E: \ \ perl_stduy \ \ test".
Print $dir.
The foreach my $x (1.. 4) {
Sub process
{
If (f $File: : Find: : name)
{
If ($File: : Find: : name=~/^. * _ $x.d at $/)
{
Print "$File: : Find: : name \ n";
Copy ($File: : Find: : name, $tardir);

}
}
}

Find (\ & amp; The process, $dir);
}
Now has written the following, but $File: : Find: : name=~/^. * _ $x.d ats, cannot match variable ah, have a solution?