in reply to CGI::Session error saying main::cookie used only once?
C:\>perl -Mwarnings -e"$cookie = 6;" Name "main::cookie" used only once: possible typo at -e line 1. C:\>perl -Mwarnings -Mstrict -e"$cookie = 6;" Global symbol "$cookie" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors. C:\>perl -Mwarnings -Mdiagnostics -e"$cookie = 6;" Name "main::cookie" used only once: possible typo at -e line 1 (#1) (W once) Typographical errors often show up as unique variable nam +es. If you had a good reason for having a unique name, then just menti +on it again somehow to suppress the message. The our declaration is provided for this purpose. NOTE: This warning detects symbols that have been used only once s +o $c, @c, %c, *c, &c, sub c{}, c(), and c (the filehandle or format) are con +sidered the same; if a program uses $c only once but also uses any of the +others it will not trigger this warning. C:\>perl -Mwarnings -Mstrict -Mdiagnostics -e"$cookie = 6;" Global symbol "$cookie" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors (#1) (F) You've said "use strict vars", which indicates that all variab +les must either be lexically scoped (using "my"), declared beforehand +using "our", or explicitly qualified to say which package the global var +iable is in (using "::"). Uncaught exception from user code: Global symbol "$cookie" requires explicit package name at -e l +ine 1. Execution of -e aborted due to compilation errors. at -e line 1 C:\>
|
|---|