in reply to Why is "\n" displayed as space in browser?

When I run your code, I get a lot of
[Mon Mar 16 23:05:22 2009] pm: Use of uninitialized value $ENV in conc +atenation (.) or string [...]

errors. Perhaps you should have used

print "$key = $ENV{ $key }<br>"; # ^------^ braces, not parentheses

instead (which also includes moritz's suggestion).