From: | Mark Buckle <mark.buckle [...] intechsolutions.co.uk> |
To: | "'bug-smart-comments [...] rt.cpan.org'" <bug-smart-comments [...] rt.cpan.org> |
Subject: | Bug in Smart::Comments ??? |
Date: | Wed, 10 Aug 2005 11:16:11 +0100 |
Hi Damian.
I'm not sure whether or not you'll be able to do anything useful with the
following error report:-
Using smart comments seems to provoke an error in my cheesy DBI.pm subclass
:_
(Using perl 5.8.0 on cygwin, using latest Smart::Comments ( down-loaded 3
days ago. ))
Error message :-
Can't bless non-reference value at
/usr/lib/perl5/site_perl/5.8.0/Intech/DBIx.pm line 46.
This is a cut-down test-case version. The database being connected to is a
SQL Server Database using ODBC.
As this DB/driver combination already exhibits non-standard, non-useful
behaviours in other ways, I suspect that this is just another one of them.
On the other hand it could be my cheesy DBI sub-classing at fault.
Unfortunately I don't have a viable database source other than SQL Server to
test against. DBD::CSV for one *doesn't* provoke this error,
but then again I'll never need to run any of my scripts against a CSV file.
-- test script
#!/usr/bin/perl
use warnings ;
use strict ;
use Smart::Comments ;
use Intech::DBIx ;
my $src_dbh = Intech::DBIx->connect( 'db'
, 'user'
, 'passwd'
, { RaiseError => 0
, PrintError => 0
, AutoCommit => 0
}
) ;
--cutdown version of DBI sub-class package in use. The DBI->connect call
fails.
package Intech::DBIx ;
use warnings ;
use strict ;
use DBI ;
use base qw(DBI::db) ;
my $Singleton ;
sub disconnect {
my $self = shift ;
$self->SUPER::disconnect(@_) ;
$Singleton = undef ;
}
sub connect {
my $invocant = shift ;
my $class = ref($invocant) || $invocant ;
#DBI->trace(3) ;
if ( ! $Singleton ) {
my $dbi_str = shift || die "No DBI connect string" ;
my $dbi_usr = shift || die "No DBI user" ;
my $dbi_pwd = shift || die "No DBI user password" ;
my $dbi_attr = shift || die "No DBI connect attributes" ;
$Singleton = DBI->connect ( $dbi_str
, $dbi_usr
, $dbi_pwd
, $dbi_attr
) ;
#print STDERR Dumper $dbi_str ;
#print STDERR Dumper $dbi_usr ;
#print STDERR Dumper $dbi_pwd ;
#print STDERR Dumper $dbi_attr ;
#print STDERR Dumper $Singleton ;
#print STDERR Dumper $class ;
bless $Singleton, $class ;
}
#DBI->trace(0) ;
return $Singleton ;
}
1 ;
Mark Buckle, Database Administrator, Software - Insurance Technology
Solutions Ltd
Tel: 0113 220 6700 Fax: 0113 244 4201
mailto:Mark.Buckle@intechsolutions.co.uk
<mailto:Mark.Buckle@intechsolutions.co.uk>
Website: http://www.intechsolutions.co.uk/
<http://www.intechsolutions.co.uk/>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
This e-mail may contain information that is privileged, confidential or
otherwise protected from disclosure. It must not be used by, or its
contents copied or disclosed to, persons other than the intended
recipient. However, the contents of this e-mail may be intercepted,
monitored or recorded by Insurance Technology Solutions Limited for
the purposes of ensuring compliance with its policies and procedures.
Any liability (in negligence or otherwise) arising from any third party
acting, or refraining from acting, on any information contained in this
e-mail is excluded.
Any views expressed in this message are those of the individual
sender and do not necessarily represent the views of
Insurance Technology Solutions Limited.
If you have received this e-mail in error please notify the
originator of the message.
Scanning of this message and addition of this footer is performed
by SurfControl E-mail Filter software in conjunction with
virus detection software.