Error: requires explicit package name
Hello:) i am working on a script and have come across a problem. if i call a variable from the preceeding form, it works correctly, BUT, if i declare a variable within the script, then try to use it as the To: fiels in an e-mail, it tells me that Global symbol $auto requires explicit package name i have been looking through my perl and cgi books to try to figure out what this means, but am totally at a loss. i have declared it two different ways, and both ways it comes back with the same error: if ($Country eq Argentina) {my $auto = $q-param( '[EMAIL PROTECTED]' ); } and if ($Country eq Argentina) {$auto = $q-param( '[EMAIL PROTECTED]' ); } i figure i am probably missing one little thing, but i can't figure out what it is. Anyone got any ideas? This is the last part of my script that i need to get working, as it will be a huge if/elsif statement that i will end up putting into a module. thanks:) thia __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error: requires explicit package name
on Fri, 30 Aug 2002 13:58:47 GMT, [EMAIL PROTECTED] (T) wrote: Global symbol $auto requires explicit package name [...] if ($Country eq Argentina) {my $auto = $q-param( '[EMAIL PROTECTED]' ); } and if ($Country eq Argentina) {$auto = $q-param( '[EMAIL PROTECTED]' ); } A lexical my declaration is only visible in the enclosing block. You should write: my $auto; if ($Country eq Argentina) { $auto = $q-param( '[EMAIL PROTECTED]' ); } See M-J. Dominus' Coping with Scoping article for an excellent introduction to scoping at http://perl.plover.com/FAQs/Namespaces.html -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error: requires explicit package name
Felix Thanks! That was just what i needed:) thia --- Felix Geerinckx [EMAIL PROTECTED] wrote: on Fri, 30 Aug 2002 13:58:47 GMT, [EMAIL PROTECTED] (T) wrote: Global symbol $auto requires explicit package name [...] if ($Country eq Argentina) {my $auto = $q-param( '[EMAIL PROTECTED]' ); } and if ($Country eq Argentina) {$auto = $q-param( '[EMAIL PROTECTED]' ); } A lexical my declaration is only visible in the enclosing block. You should write: my $auto; if ($Country eq Argentina) { $auto = $q-param( '[EMAIL PROTECTED]' ); } See M-J. Dominus' Coping with Scoping article for an excellent introduction to scoping at http://perl.plover.com/FAQs/Namespaces.html -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]