请教windows下Perl移动文件并改名

刚才考虑不周,把 wanted 改改吧

sub wanted {
        unless (-d) {
                my ($filename, $dir) = File::Basename::fileparse($File::Find::name);
                $dir =~ s{\w:/}{};
                $dir =~ s{/}{_}g;
                $filename = File::Spec->catfile('d:/tt', $dir.$filename);
                File::Copy::move($File::Find::name, $filename);
        }
}
我把"my @dir = qw(c:/目录1 c:/目录2 c:/目录3);"一句改成了"my @dir = qw(c:/abc/a c:/abc/b c:/abc/c c:/abc/d c:/abc/e.....);
目录大约有二十个, 运行出错:  (注: 脚本文件名为yy.pl)

Global symbol "$filename" requires explicit package name at yy.pl line 13.
Global symbol "$dir" requires explicit package name at yy.pl line 13.
Global symbol "$dir" requires explicit package name at yy.pl line 13.
Unmatched right curly bracket at yy.pl line 18, at end of line
  (Might be a runaway multi-line // string starting on line 13)
syntax error at yy.pl line 18, near "$dir =~ s{\w:/}"
Global symbol "$dir" requires explicit package name at yy.pl line 19.
Global symbol "$filename" requires explicit package name at yy.pl line 20.
Global symbol "$dir" requires explicit package name at yy.pl line 20.
Global symbol "$filename" requires explicit package name at yy.pl line 20.
Global symbol "$filename" requires explicit package name at yy.pl line 21.
Unmatched right curly bracket at yy.pl line 22, at end of line
yy.pl has too many errors.

是不是目录穷举得不对了?
天知道你怎么复制的
为什么不用nested subroutine 呢?这正是它大显身手的时候啊。
错误信息已经比较明显了