in reply to Premature End of Script Headers
When I try and run it here, the only thing that stops error messages getting to the browser is the missing "!" in the first line. Try changing it to:
#!/usr/bin/perl -w [download]