in reply to extension check on upload script doesn't do anything
You are using strict (as you should), but you need to declare and initialize all your variables ($name, $extension). You created an array variable (@allowedext), but then tried to access it as if it were a hash.c:> perl -Tc 889712.pl Status: 500 Content-type: text/html <h1>Software error:</h1> <pre>Global symbol "$name" requires explicit package name at + 889712.pl line 11. Global symbol "$extension" requires explicit package name at + 889712.pl line 11. Global symbol "%allowedext" requires explicit package name a +t 889712.pl line 15. Global symbol "$extension" requires explicit package name at + 889712.pl line 15. 889712.pl had compilation errors. </pre> <p> For help, please send mail to this site's webmaster, giving this error + message and the time and date of the error. </p> [Tue Feb 22 22:34:08 2011] 889712.pl: Global symbol "$name" requires e +xplicit package name at 889712.pl line 11. [Tue Feb 22 22:34:08 2011] 889712.pl: Global symbol "$extension" requi +res explicit package name at 889712.pl line 11. [Tue Feb 22 22:34:08 2011] 889712.pl: Global symbol "%allowedext" requ +ires explicit package name at 889712.pl line 15. [Tue Feb 22 22:34:08 2011] 889712.pl: Global symbol "$extension" requi +res explicit package name at 889712.pl line 15. [Tue Feb 22 22:34:08 2011] 889712.pl: 889712.pl had compilation errors +.
See also Troubleshooting Perl CGI scripts
|
|---|