当我像这样使用require加载File::Find时,如何修改此脚本以不收到警告?
#!/usr/bin/env perl
use warnings;
use strict;
use 5.10.1;
require File::Find;
File::Find->import('find');
find( {
wanted => sub {
my $file = $File::Find::name;
#say $file;
},
no_chdir => 1,
},
shift );
输出:
#Name "File::Find::name" used only once: possible typo at ./perl9.pl line 11.