Skip Menu |

This queue is for tickets about the DBIx-Table-TestDataGenerator CPAN distribution.

Report information
The Basics
Id: 81686
Status: resolved
Priority: 0/
Queue: DBIx-Table-TestDataGenerator

People
Owner: JDS [...] cpan.org
Requestors: bohica [...] ntlworld.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.001
Fixed in: (no value)



Subject: pod shows a method create but there does not seem to be one
Is the "create" method in the pod really supposed to be create_testdata? use strict; use warnings; use DBI; use DBIx::Table::TestDataGenerator; my $h = DBI->connect('dbi:Oracle:host=xxx;sid=xxx', 'xxx', 'xxx', {RaiseError => 1}); my $generator = DBIx::Table::TestDataGenerator->new( dbh => $h, table => 'market', ); $generator->create({ target_size => 1, num_random => 1, seed => 1, }); $ perl dbix_table_testdatagenerator.pl Can't locate object method "create" via package "DBIx::Table::TestDataGenerator" at dbix_table_testdatagenerator.pl line 13. Also, it shows passing a hash reference but create_testdata appears to want an even list. use strict; use warnings; use DBI; use DBIx::Table::TestDataGenerator; my $h = DBI->connect('dbi:Oracle:host=xxx;sid=xxx', 'xxx', 'xxx', {RaiseError => 1}); my $generator = DBIx::Table::TestDataGenerator->new( dbh => $h, table => 'market', ); $generator->create_testdata({ target_size => 1, num_random => 1, seed => 1, } $ perl dbix_table_testdatagenerator.pl Reference found where even-sized list expected at /home/martin/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/DBIx/Table/TestDataGenerator.pm line 38.); sub create_testdata { my $self = shift; my %args = @_; <--------------- here Martin -- Martin J. Evans Wetherby, UK
Am Di 04. Dez 2012, 04:52:41, MJEVANS schrieb: Show quoted text
> Is the "create" method in the pod really supposed to be > create_testdata? > > use strict; > use warnings; > use DBI; > use DBIx::Table::TestDataGenerator; > > my $h = DBI->connect('dbi:Oracle:host=xxx;sid=xxx', > 'xxx', 'xxx', {RaiseError => 1}); > > my $generator = DBIx::Table::TestDataGenerator->new( > dbh => $h, > table => 'market', > ); > $generator->create({ > target_size => 1, > num_random => 1, > seed => 1, > }); > > $ perl dbix_table_testdatagenerator.pl > Can't locate object method "create" via package > "DBIx::Table::TestDataGenerator" at dbix_table_testdatagenerator.pl > line 13.
Yes, I forgot to rename the method in the POD. Show quoted text
> Also, it shows passing a hash reference but create_testdata appears to > want an even list. > > use strict; > use warnings; > use DBI; > use DBIx::Table::TestDataGenerator; > > my $h = DBI->connect('dbi:Oracle:host=xxx;sid=xxx', > 'xxx', 'xxx', {RaiseError => 1}); > > my $generator = DBIx::Table::TestDataGenerator->new( > dbh => $h, > table => 'market', > ); > $generator->create_testdata({ > target_size => 1, > num_random => 1, > seed => 1, > } > > $ perl dbix_table_testdatagenerator.pl > Reference found where even-sized list expected at > /home/martin/perl5/perlbrew/perls/perl- > 5.16.0/lib/site_perl/5.16.0/DBIx/Table/TestDataGenerator.pm > line 38.); > > sub create_testdata { > my $self = shift; > my %args = @_; <--------------- here > > Martin
The POD is wrong here, too, an even list / hash must be passed.
Pod referred to an old version, it has been fixed.