Subject: | new() constructor doesn't return undef on failure |
There appears to be a minor bug in the new() method, which prevents the
caller from telling if the call failed to open a large object that
doesn't exist.
use DBI;
use IO::BLOB::Pg;
my $dbh = ...;
my $blob = IO::BLOB::Pg->new($dbh, 123456789) # some random value
or die; # this never happens
What I've done to correct it is to alter the last couple of lines of
new():
tie *$self, $self;
return $self->open(@_) ? $self : undef;