in reply to Re: Converting Unix to NT
in thread Converting Unix to NT

Thanks. Cool. So here's what I got: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: Global symbol "$q" requires explicit package name at e:\inetpub\awesomelibrary.net\cgi-bin\awesome.pl line 132. Global symbol "$sess_id" requires explicit package name at e:\inetpub\awesomelibrary.net\cgi-bin\awesome.pl line 134. Global symbol "$usr_name" requires explicit package name at e:\inetpub\awesomelibrary.net\cgi-bin\awesome.pl line 136. Global symbol "$password" requires explicit package name at e:\inetpub\awesomelibrary.net\cgi-bin\awesome.pl line 137. Global symbol "$PATH" requires explicit package name at e:\inetpub\awesomelibrary.net\cgi-bin\awesome.pl line 140. Global symbol "$MAIN_PANEL" requires explicit package name at e:\inetpub\awesomelibrary.net\cgi-bin\awesome.pl line 150. Global symbol "$TEMPLATE" requires explicit package name at e:\inetpub\awesomelibrary.net\cgi-bin\awesome

Replies are listed 'Best First'.
RE: RE: Re: Converting Unix to NT
by chromatic (Archbishop) on Aug 24, 2000 at 04:22 UTC
    Aha. What you need to do is tell Perl that you want to use these variables. Generally, that's done something like this:
    #!/usr/bin/perl -wT # or #!c:/perl/bin/perl -wT use strict; my $q; my $sess_id; my $usr_name; my $password;
    and so forth. If you're familiar with scoping rules in another language, you'll find that Perl is pretty similar.
      If there is any chance that you will want to run this using mod_perl, it is important to change those declarations to:
      use vars qw ( $q $sess_id $usr_name $password );
      I tried to explain why at RE (3): BrainPain-Help, don't think I succeeded. If someone wants to give me feedback on how to improve that description, I would appreciate it....

      EDIT
      Note that the mod_perl issue is likely to be an issue with other "fast CGI" type approaches like FastCGI and ASP. The underlying problem is not Apache/mod_perl, it is with how Perl names things.