in reply to code working fine in cgi-bin but not outside cgi-bin

This not related to Perl itself, rather to your web-server configuration, e.g. httpd.conf.
  • Comment on Re: code working fine in cgi-bin but not outside cgi-bin