my $regex = { 'txt' => qr{.*txt$}i, 'conf' => qr{.*conf$}i # ... and so on }; opendir DH, '.'; while(my$file=readdir(DH)){ for (keys %$regex){ if ($file =~ /$regex->{$_}/){ print "$file has ", uc$_, " ext\n" } } }
In reply to Re: Integrating System commands with regex's
by sh1tn
in thread Integrating System commands with regex's
by rsiedl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |