pskiz has asked for the wisdom of the Perl Monks concerning the following question:
i cant figure out why this isnt working. ive declared all the variables using 'my', and the search pattern works on another server that uses this script.#!/usr/local/bin/perl -wT use strict; use CGI qw(:all); # used to store username my $USERNAME = param('name'); print header; # the submit parameter is only passed if this program was executed by +the submit button if (defined param('submit')) # if its called by the form then save use +r info and display add inventory page { my $loginPath = $USERNAME . ".txt"; if (open(USER, "<$loginPath")) { while (my $lineData = <USER>) { chomp $lineData; my ($name, $password) = split /:/, $lineData; if ($name eq $USERNAME && $password eq param('pw')) { saveInfo(); writeAddInv(); } else # if the user is not in the list then display the log +in page { $printErrMsg = 1; # set to true (user is not in list) writeLogin(); } } } else { $printErrMsg = 1; # set to true (user is not in list) writeLogin(); } close(USER); } else # if not called by form { writeLogin(); # display login page } and here are the errors im getting: Global symbol "$loginPath" requires explicit package name at /opt2/gri +ffass/httpd/cgi-bin/tapeAndLabelLogin.cgi line 488. Global symbol "$loginPath" requires explicit package name at /opt2/gri +ffass/httpd/cgi-bin/tapeAndLabelLogin.cgi line 488. Global symbol "$lineData" requires explicit package name at /opt2/grif +fass/httpd/cgi-bin/tapeAndLabelLogin.cgi line 488. Global symbol "$lineData" requires explicit package name at /opt2/grif +fass/httpd/cgi-bin/tapeAndLabelLogin.cgi line 488. Global symbol "$name" requires explicit package name at /opt2/griffass +/httpd/cgi-bin/tapeAndLabelLogin.cgi line 488. Global symbol "$password" requires explicit package name at /opt2/grif +fass/httpd/cgi-bin/tapeAndLabelLogin.cgi line 488. syntax error at /opt2/griffass/httpd/cgi-bin/tapeAndLabelLogin.cgi lin +e 539, near "my ($name, $password) = split /:" (Might be a runaway multi-line // string starting on line 488) Search pattern not terminated at /opt2/griffass/httpd/cgi-bin/tapeAndL +abelLogin.cgi line 539. [Fri Aug 19 10:46:35 2005] [error] [client 64.80.205.90] Premature end + of script headers: /opt2/griffass/httpd/cgi-bin/tapeAndLabelLogin.cg +i
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: problem with explicit package name
by davorg (Chancellor) on Aug 19, 2005 at 15:12 UTC | |
Re: problem with explicit package name
by Transient (Hermit) on Aug 19, 2005 at 15:15 UTC | |
Re: problem with explicit package name
by Ven'Tatsu (Deacon) on Aug 19, 2005 at 16:25 UTC |