switch ($folder) { case m/(do not use|not used|delete(d?))/i { $include = 0; DEBUG("This one shouldn't be included"); next; } case m/(FINAL|DRAFT)/ { ($status) = $folder =~ m/(FINAL|DRAFT)/; DEBUG("case 0 = the status is '$status'"); next; } case m/($m_dateMonth)\s\d{2,4}/i { ($date) = $folder =~ m/(($m_dateMonth)\s\d{2,4})/i; DEBUG("case 1 = the date is '$date'"); next; } case m/\(($m_regions)\)/i { ($region) = $folder =~ m/\(($m_regions)\)/i; DEBUG("case 2 = the region is '$region'"); next; } case m/(MMF|ANDA|NDA|IND)/i { ($applicationType) = $folder =~ m/(MMF|ANDA|NDA|IND)/i; DEBUG("case 4 = the application type is '$applicationType'"); next; } case m/(\d{2,3}-?\d{3,4})/ { ($applicationNumber) = $folder =~ m/(\d{2,3}-?\d{3,4})/; DEBUG("case 6 = the application number is '$applicationNumber'"); next; } }