Regards, Peter
Tim Bunce wrote:
I wouldn't hold out much hope of getting DBI and Safe to work together like that. Safe is pretty much a failed experiment. Still useful in some cases but generally painful to use and always difficult to prove how much 'safety' you end up with.
If you really want to press on then at least upgrade to perl 5.8.1 (release candidate 5 should be available any day now), and don't expect much help from others as few people have delved into the depths of Safe. The [EMAIL PROTECTED] list is probably the best place.
Good luck.
Tim.
On Tue, Sep 09, 2003 at 07:44:07PM -0700, Peter wrote:
Is this a bug or something else? Can someone please give me some direction about where to look or go to solve this problem?
The error message is:
Can't locate object method "TIEHASH" via package "DBI::st" at /usr/lib/perl5/site_perl/5.6.1/i386-linux/DBI.pm line 1053.
I managed to reproduce the error in this simple test program: #!/usr/bin/perl -w use strict; use integer;
use DBI; use Safe;
our $dbh = DBI->connect("dbi:Pg:dbname=mydb", 'username', 'password');
$dbh->{AutoCommit} = 0; # Don't commit changes to the db until we're done
$dbh->{RaiseError} = 1; # die if there's a db error (thereby preventing us from writing partial data to the db)
our $safe = new Safe; $safe->share_from('main',['$dbh']);
our $safecode = <<END; \$dbh->prepare("SELECT * FROM mytable"); END
$safe->reval($safecode,1); die $@ if $@;
exit;
Thanks in advance,
Peter
