Se o seu script estiver tentando usar o Arquivo :: Localizar , altere FILE
para File
. Perl diferencia maiúsculas de minúsculas.
BTW, postar um comentário na mensagem de erro também seria bom, sem mencionar uma pergunta.
Atualização: Depois de ver seu código, eu posso identificar alguns problemas: você provavelmente define $ count e $ match em um escopo errado (difícil de dizer, porque você nunca usa $ match). Tentei corrigir o problema:
#!/usr/bin/perl
use warnings;
use strict;
use File::Find;
use File::Slurp;
my $in_dir = '/home/prodigydell3/verilog';
my @all_files;
my $pattern = 'test>clk(\n|\t|\s)</test';
find(sub {
push @all_files, $File::Find::name if (-f $File::Find::name);
}, $in_dir);
foreach my $file_ (@all_files) {
my $count = 0;
my $match;
my @file_con = read_file($file_);
foreach my $con (@file_con) {
$match = 1 if $con =~ m/$pattern/igs;
$count++;
}
print "The pattern is found in $file_ and number of lines is $count \n" if $match;
}