in reply to I go crazy with windows filenames with spaces!

In both snippets, right before opendir, print $path. You'll notice they're different.

"c:/documents\ and\ settings/username/desktop/perf_analyzer"
is the same thing as
"c:/documents and settings/username/desktop/perf_analyzer"
Both of the above produce the string
c:/documents and settings/username/desktop/perf_analyzer

Expressions that produce the string

c:\documents and settings\username\desktop\perf_analyzer
would also be fine. Your bug is
$path=~s/\s{1}/\\ /g;
You are causing the string to become
c:/documents\ and\ settings/username/desktop/perf_analyzer

That's bad, because there's no directory c:\documents

Fixed code:

chomp( my $path = `cd` ); opendir MYDIR, $path or die("Can't open dir $path: $!\n");

Even better:

opendir MYDIR, '.' or die("Can't open current dir: $!\n");