in reply to Re^2: How to look for two different file extensions?
in thread How to look for two different file extensions?

A little more - I hope - clarification. The code you have given translates roughly thus: "If the variable evaluates to '.xlsx' or if '.pdf' evaluates to true". IIRC, COBOL - at least some dialects - would do what you mean in this context, but Perl is more powerful and it's quite common for programmers to put in a variable (or even a constant like DEBUG) into a conditional, which is why the compiler doesn't treat your code as you meant it. I remember running into this while taking courses in Pascal and COBOL concurrently - nearly 40 years ago.

Regards,

John Davies

Update: memories came flooding back overnight, including the fact that I have the COBOL for Univac 1100 manual, which says:

In a compound conditional expression ... the subject may be implied. For example, AGE IS GREATER THAN 21 OR LESS THAN 65 ... Operators, as well as subjects, may be implied ... for example, DISTRICT IS EQUAL TO 25 OR EQUAL TO 66 OR EQUAL TO 85 may be written as, DISTRICT IS EQUAL TO 25 OR 66 OR 85

The fun came when someone (not I) wrote X NOT EQUAL TO Y OR Z and it took lots of expansion and De Morgan's laws to explain that he needed to replace OR with AND.