Home > OS >  Why can't CMD running the following Perl code to copy?
Why can't CMD running the following Perl code to copy?

Time:09-22

#! The/usr/bin/perl
Use strict;
Use warnings;

My $newDir="files";
Unless (-d $newDir)
{
The mkdir $newDir or die $! ;
}

My @ allFiles=glob (" * ");
The foreach my $subDir (@ allFiles)
{
If (-d $subDir)
{
Opendir (SUB, ". \ \ $subDir ") or die $! ;
While (my $file=readdir (SUB))
{
If ($file=~/\. $/gz)
{
` copy. \ \ $subDir \ \ $file \ \ $newDir `;
}
}
Close (SUB);
}
}

CodePudding user response:

CMD can run perl code? Not so used,,,

CodePudding user response:

Describe a mistake, it is perl code for this, in the CMD running putfiletoone. Pl
  • Related