in reply to Re^2: How to pass Windows filepaths on command line
in thread How to pass Windows filepaths on command line

Your error message has single quotes, but your code does not. Try without the single quotes:
perl test.pl --file=test.txt