See this and follow the links deep, it discusses same problems your code has (in addition to what Eliya said)
The cgi documentation says $CGI::DISABLE_UPLOADS not $main::q::DISABLE_UPLOADS
See also Tutorials: Variable Scoping in Perl: the basics, Coping with Scoping , and start making subs/passing them arguments
In reply to Re: @CGI $q->upload() doesnt work properly
by Anonymous Monk
in thread @CGI $q->upload() doesnt work properly
by AlexTape
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |