Hi all,

Excuse me for my poor English because I'm from Russia.

I have the problem with url translation.
There are 2 scripts to do it.
1st script work perfectly, but 2nd failed.
Only difference between them is string "my $dbh = DBI->connect...";
I use Apche::DBI but without this module the same thing happens.
Why?

1st:
package Apache::StripSession
use strict;
use Apache;
use Apache::Constants qw(:common);

sub handler {
    my $r = shift;

    return DECLINED unless $r->uri =~ /^\/session\/([a-zA-Z0-9]{32})(.*)/;

    $r->subprocess_env(SESSION => $1);
    $r->uri($2);

    return DECLINED;
}

2nd:
package Apache::StripSession;
use strict;
use Apache;
use Apache::Constants qw(:common);

sub handler {
    my $r = shift;

    my $dbh = DBI->connect('dbi:mysql:db', 'user', 'pswd');
    $dbh->disconnect;
    return DECLINED unless $r->uri =~ /^\/session\/([a-zA-Z0-9]{32})(.*)/;

    $r->subprocess_env(SESSION => $1);
    $r->uri($2);

    return DECLINED;
}


Reply via email to