Alexander Bl�m wrote:
I solved the problem... not using OO-style, but function-style.

like this:

...
use Digest::MD5 qw(md5_hex);
...
 $r->print( "<pre>$pw -&gt; ".md5_hex($pw)."</pre>" );
...


*tadaa*

Well, you skirted the problem and it works so that is fine, but it would be good to get to the root of the problem, and my suspicion was that in the mod_perl context the object was getting cached and you were getting the hash of the hash, etc. since the object is scoped such that it is never explicitly cleaned up. This is more for my understanding of mod_perl than anything else, but could you test it? Anyone else have any insights??


http://danconia.org




Alexander Bl�m wrote:


hello

I ran into an odd problem, that I cannot explain to myself...

I use mod_perl 1.27 and apache 1.3.27... the commandline script works perfectly:
perl -mDigest::MD5 -we 'print new Digest::MD5->md5_hex("lol")."\n"'
returns "fe5608e20902819328733f5e672b6af6" each time I run the script.


ok... I added this to my mod_perl script, and whenever I refresh, I get different results EACH refresh... that's not the way it's supposed to be...


here is my script that returns a different value each time....



##########> THE MOD_PERL SCRIPT: <##########


#!/usr/bin/perl -w

use strict;
use Digest::MD5;

our $r = shift;
my $md5 = new Digest::MD5;

my $pw = "lol";

$r->no_cache(1);
$r->send_http_header('text/html');
$r->print(&_head("", ""));
$r->print( "<pre>$pw -&gt; ".$md5->md5_hex($pw)."</pre>" );
$r->print(&_foot());


sub _head{ my $page = shift; my $sid = shift; my $output=<<XXX; <HTML> <HEAD><TITLE>GATWU</TITLE></HEAD> <BODY> XXX return $output; }


sub _foot{ my $output=<<XXX; </BODY> </HTML> XXX return $output; }






--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  • md5 Alexander Bl�m
    • Re: md5 Alexander Bl�m
      • Wiggins d'Anconia

Reply via email to