Using my incredible magic powers, I shall guess that you are uploading a perl script with line endings in windows format, to a linux type machine, and not converting the line endings. Thus your shebang actually looks like
#!/usr/bin/perl^M and perl^M doesn't exist on the machine so it doesn't run. This of course has nothing to do with apache or perl, but when you add -w infront of the ^M, the kernel can find the appropiate interpreter and perl ignores the ^M.
Insert sound of my hand forcefully hitting my forehead here. Yes!! Thank you, I feel better now---the slap helped, but the explanation helped even more.
--hsm
"Never try to teach a pig to sing...it wastes your time and it annoys the pig."