What value is in $output?
You can inspect the value in $output by doing:
print $output; [download]
See index.
In reply to Re: perl script by Corion in thread perl script by ronak