Your code contains lots of syntax errors. For example the name of your subroutine is spelled in two different ways. This is wrong.
In Perl, checking whether a single value matches a regular expression is best done by using the =~ operator, see perlop. Instead of
grep(/.../, $item)
use
$item =~ /.../
Also, it helps very much to understand code if it is indented properly. So, for each block, indent that block by (say) four spaces, until that block ends. This shows the structure that underlies your code. For example the first foreach loop will look like this if properly indented:
foreach my $plf (@plf_files) { print $plf; if (grep (/\Q$plf\E/i,@file)) { push @recursive_plfs,$plf; recrusion($plf); } }
This makes it far easier to spot what code belongs to which branch.
In reply to Re^3: Recursive search
by Corion
in thread Recursive search
by perl_mystery
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |