in reply to HASH question

Going strictly on the information you've given, the problem you are seeing makes little sense. I suspect there is more to it. If you are running under mod_perl and making changes to the code but not making sure the server reloads that code, you may not be testing what you think you are...

Can you give us more information?

-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re: Re: HASH question
by apessos (Acolyte) on Nov 11, 2002 at 20:47 UTC
    I hope this is helpful. This is the "email me my password" code:
    [% my $str; $str.="Forgot your username or password? All we need is one of the f +ollowing blanks filled in correctly and you should be able to find th +e answers to your most perplexing question"; $str.=$query->start_form("POST", $ENV{SCRIPT_NAME}); $str.='<INPUT TYPE="hidden" NAME="op" VALUE="lostpasswd">'; $str.=$query->hidden('node_id',getId($NODE)); $str.="Your username:"; $str.='<INPUT TYPE="text" NAME="username" VALUE=""><br>'; $str.="Your e-mail address:"; $str.='<INPUT TYPE="text" NAME="email" VALUE=""><br>'; $str.=$query->submit("sexisgood", "Mail me my password, Cowboy!"); $str.=$query->end_form; if($query->param('op') eq 'lostpasswd' and ($query->param('username' +) || $query->param('email'))){ my $haverow=0; my $username=$query->param('username'); my $email=$query->param('email'); my @N; if($username){ @N = getNode($username, getType('user')); $haverow=$N[0]; } if(!$haverow and $email){ @N=$DB->getNodeWhere ({email => $email}, $DB->getType('user' +)); $haverow=$N[0]; } if($haverow){ my ($n) = getNode('Password Mail', getType('mail')); $$n{doctext} =~ s/\<name\>/$$haverow{realname}/; $$n{doctext} =~ s/\<user\>/$$haverow{title}/; $$n{doctext} =~ s/\<passwd\>/$$haverow{passwd}/; $$n{doctext} =~ s/\<site_name\>/$HTMLVARS{site_name}/; $$n{doctext} =~ s/\<site_url\>/$HTMLVARS{site_url}/; use Everything::MAIL; my $addr = node2mail($$haverow{email},$n); $n = getNodeById(getId($n), 'force'); $str.="<BR><H3>Your password and username should be on its wa +y</H3>"; $str.= "Addr7: " . $addr; print "<BR>$addr"; } else{ $str="<B>Couldn't find any info that matched what you gave us +, make sure you typed in everything correctly!</B><BR><BR>".$str; } } $str; %]

    To see what is going on, gohere.

    Enter apessos as the username and any email address. The code is very similar to what I have already posted. The node2mail is a package stored at /usr/local/lib/perl5/site_perl/5.6.1/Everything.

    If there is any other piece of information that would be helpful, let me know.

Re: Re: HASH question
by apessos (Acolyte) on Nov 11, 2002 at 21:55 UTC
    You know, something that you said didn't sit right with me. The part about the server not reloading the code. So, I restarted Apache and I don't get that hash output anymore. I wonder if that means I have to restart Apache each time I make a change?
      No, just add
      PerlModule Apache::StatINC PerlInitHandler Apache::StatINC
      to your httpd.conf.

      Reading the Guide is essential when maintaining a mod_perl based system.

      rdfield