in reply to WinNT Opendir with CGI

Tilt that backslash over.
opendir(DIR, "c:/$directory") ... ^
As is, you're quoting '$'.

For extra credit, explain what, if anything, this has to do with CGI.pm