I am trying to pretty much look for either ".xlsx" or ".pdf" file extensions within a directory, and if it finds them, do X, Y, and Z. This works if I just specify ".xlsx" but not the two or more together
while ($filename = readdir(DIR)) # read all entries +in directory { if (-f $filename) { if ($filename ne $SumRptName) # do NOT include th +e summary report file { $FileExt = ""; ($BaseFileName, $FileDir,$FileExt) = fileparse($filename +, qr/\.[^.]*/); print "$FileExt\n"; if ($FileExt eq ".xlsx") + # look for either .xlsx or .pdf || if ($FileExt eq ".pdf") { if (length($FileExt) > 3) { $FileExt = substr($FileExt, 1, 3); $OverrideExt = "/FileType=$FileExt "; } else { $OverrideExt = ""; } if ($FolderPerFile) # add BaseFile +Name to folder path { $Finalfld = $fld . $BaseFileName . "/"; } else { $Finalfld = $fld; }
In reply to How to look for two different file extensions? by Superbroom2.0
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |