I am trying to test the Apache::Session::Oracle
Here is the error I am getting. What is wrong? I was able to
successfully install and test Apache::Session which tested
Apache::Session::Oracle
This is the error.
[Mon Mar 11 14:01:23 2002] [error] Can't locate object method "TIEHASH" via package
"Apache::Session::Oracle" at /opt/apache/perl/example.perl line 33.
This is the code I am testing.
use strict;
use Apache;
use CGI;
use Apache::Session::File;
my $db_user = 'user';
my $db_pass = 'pass';
my $r = Apache->request();
$r->status(200);
$r->content_type("text/html");
my $session_id = $r->path_info();
$session_id =~ s/^\///;
$session_id = $session_id ? $session_id : undef;
my %session;
tie %session, 'Apache::Session::Oracle', $session_id, {
DataSource => 'dbi:Oracle:sgum',
UserName => $db_user,
Password => $db_pass,
Commit => 1
};
my $input = CGI::param('input');
$session{name} = $input if $input;
print<<__EOS__;
Hello<br>
Session ID number is: $session{_session_id}<br>
The Session ID is embedded in the URL<br>
<br>
Your input to the form was: $input<br>
Your name is <b>$session{name}</b><br>
<br>
<a href="http://penguin:8080/perl/example.perl/$session{_session_id}">Reload this
session</a><br>
<a href="http://penguin:8080/perl/example.perl">New session</a>
<form action="http://penguin:8080/perl/example.perl/$session{_session_id}"
method="post">
Type in your name here:
<input name="input">
<input type="submit" value="Go!">
</form>
__EOS__
--
Brian Lavender
http://www.brie.com/brian/