hello, i wrote a rudimentary log on script that pretty much just checks to see if a file is there, and if it is it pulls the username and pw from the file and compares them to the ones entered on an html form. for some reason it doesnt work. here is the code:
#!/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
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.

In reply to problem with explicit package name by pskiz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.