Skip to content

Commit

Permalink
Perl critic: File handles should not be bare words.
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-zeman committed Nov 12, 2024
1 parent 5840d72 commit 836f9a7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/Lingua/Interset.pm
Original file line number Diff line number Diff line change
Expand Up @@ -266,19 +266,19 @@ sub _find_drivers
my $tpath = "$path/tagset";
if(-d $tpath)
{
opendir(DIR, $tpath) or confess("Cannot read folder $tpath: $!\n");
my @subdirs = readdir(DIR);
closedir(DIR);
opendir(my $dir, $tpath) or confess("Cannot read folder $tpath: $!\n");
my @subdirs = readdir($dir);
closedir($dir);
foreach my $sd (@subdirs)
{
my $sdpath = "$tpath/$sd";
if(-d $sdpath && $sd !~ m/^\.\.?$/)
{
# It is possible that a subfolder of $PERLLIB is not readable.
# We cannot complain about it. We will just silently proceed to the next available folder.
opendir(DIR, $sdpath) or next;
my @files = readdir(DIR);
closedir(DIR);
opendir(my $dir, $sdpath) or next;
my @files = readdir($dir);
closedir($dir);
foreach my $file (@files)
{
my $fpath = "$sdpath/$file";
Expand All @@ -304,19 +304,19 @@ sub _find_drivers
my $lipath = "$path/Lingua/Interset/Tagset";
if(-d $lipath)
{
opendir(DIR, $lipath) or confess("Cannot read folder $lipath: $!\n");
my @subdirs = readdir(DIR);
closedir(DIR);
opendir(my $dir, $lipath) or confess("Cannot read folder $lipath: $!\n");
my @subdirs = readdir($dir);
closedir($dir);
foreach my $sd (@subdirs)
{
my $sdpath = "$lipath/$sd";
if(-d $sdpath && $sd !~ m/^\.\.?$/)
{
# It is possible that a subfolder of $PERLLIB is not readable.
# We cannot complain about it. We will just silently proceed to the next available folder.
opendir(DIR, $sdpath) or next;
my @files = readdir(DIR);
closedir(DIR);
opendir(my $dir, $sdpath) or next;
my @files = readdir($dir);
closedir($dir);
foreach my $file (@files)
{
my $fpath = "$sdpath/$file";
Expand Down

0 comments on commit 836f9a7

Please sign in to comment.