Dos dir command from within Perl produces different results in Windows 7 and Windows 10

Posted by jacksrok on 2016-12-13 15:45

I have an application that uses the line:

@files_ls = `dir`;

I use the result to produce a sorted list by time and I optionally only print files that match a regular expression.

The output is different between windows 7 and windows 10. The former has all the date info, the latter only produces the file name.

In a regular DOS prompt I get the same result on both systems.

Does anyone have a clue as to how to circumvent this problem?