--- /dev/null
+use strict;
+use Module::Build;
+
+my %arguments = (
+ create_makefile_pl => 'passthrough',
+ license => 'perl',
+ module_name => 'DBIx::Class',
+ requires => {
+ 'DBI' => 0,
+ 'NEXT' => 0,
+ 'DBD::SQLite' => 1.08
+ },
+ create_makefile_pl => 'passthrough',
+ create_readme => 1,
+ test_files => [ glob('t/*.t'), glob('t/*/*.t') ]
+);
+
+Module::Build->new(%arguments)->create_build_script;
+
package DBIx::Class;
+use strict;
+use warnings;
+
use base qw/DBIx::Class::CDBICompat DBIx::Class::Core/;
+use vars qw($VERSION);
+
+$VERSION = '0.01';
+
1;
use warnings;
use base qw/DBIx::Class::CDBICompat::Convenience
+ DBIx::Class::CDBICompat::Stringify
DBIx::Class::CDBICompat::ObjIndexStubs
DBIx::Class::CDBICompat::DestroyWarning
DBIx::Class::CDBICompat::Constructor
DBIx::Class::CDBICompat::ColumnGroups
DBIx::Class::CDBICompat::ImaDBI/;
- # DBIx::Class::CDBICompat::Stringify
1;
use strict;
use warnings;
+use Scalar::Util;
+
use overload
- '""' => sub { shift->stringify_self };
+ '""' => sub {
+ return Scalar::Util::refaddr($_[0]) if (caller)[0] eq 'NEXT';
+ return shift->stringify_self; },
+ fallback => 1;
sub stringify_self {
my $self = shift;
- #return (ref $self || $self) unless $self; # empty PK
- #return ref $self unless $self;
my @cols = $self->columns('Stringify');
- #@cols = $self->primary_column unless @cols;
- #return join "/", map { $self->get($_) } @cols;
+ @cols = $self->primary_column unless @cols;
+ my $ret = join "/", map { $self->get($_) } @cols;
+ return $ret || ref $self;
}
1;