Thanks Uwe, it is able to locate the Schema now, but now I am getting new error.
i could not find something simple (to understand) on internet to figure out/ or
fix this. I would appreciate any help.
$ insertdb.pl
DBIx::Class::Schema::populate(): Can't find source for testdbusers at
./insertdb.pl line 18
$ ls -R testdb
testdb:
Mysqltestdb
testdb/Mysqltestdb:
Schema Schema.pm
testdb/Mysqltestdb/Schema:
Result ResultSet
testdb/Mysqltestdb/Schema/Result:
Testdbtask.pm Testdbuser.pm
testdb/Mysqltestdb/Schema/ResultSet:
modified insertdb.pl=====================================
#!/usr/bin/perl
use strict;
use warnings;
use lib '../';
use Mysqltestdb::Schema;
my ($schema);
my (@users);
$schema = Mysqltestdb::Schema->connect("dbi:mysql:Mysqltestdb:localhost:3306",
'rootuser', 'mysqlpassword');
@users = (['test123'], ['test456']);
$schema->populate('testdbusers', [
[qw/userid/],
@users,
]);
===================================================
From: Uwe Völker <[email protected]>
To: Rajeev Prasad <[email protected]>; DBIx::Class user and developer list
<[email protected]>
Sent: Tuesday, August 30, 2011 2:53 AM
Subject: Re: [Dbix-class] getting error; DBIx::Class not finding Schema created
with schema loader
You need to add testdb to @INC:
use lib '../testdb';
(right before "use Mysqltestdb::Schema;")
2011/8/30 Rajeev Prasad <[email protected]>:
> I tried mentioning the path where schema was created, but i am getting
> error: can someone hel resolve? thx. Rajeev
>
>
> /home/someplace/cgi-bin/insertdb.pl
> /home/someplace/testdb/Mysqltestdb/Schema/ResultSet
>
> insertdb.pl===================================
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> use Mysqltestdb::Schema;
> Mysqltestdb::Schema->dump_to_dir('../testdb/');
>
> my $schema =
> Mysqltestdb::Schema->connect("dbi:mysql:mysqltestdb:localhost:3306",
> 'rootuser', 'mysqlpassword');
>
> my @users = (['test123'], ['test456']);
> $schema->populate('testdbusers', [
> [qw/userid/],
> @testdbuserss,
> ]);
>
>
> +++++++++++++++
> error:
> $ insertdb.pl
> Can't locate Mysqltestdb/Schema.pm in @INC (@INC contains: /etc/perl
> /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5
> /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10
> /usr/local/lib/site_perl .) at ./insertdb.pl line 6.
> BEGIN failed--compilation aborted at ./insertdb.pl line 6.
>
>
>
>
>
>
>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/[email protected]
>_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]