o.k., I found a possible solution to my problem described in my last post, i.e. to
>... > But later on I tried to use the rand function (note that I used an eval > here too since I hoped the late evaluation would perhaps help): > > -----start code---- > my $random_row; > eval '$random_row = $dbic_schema->resultset("T")->rand->single;'; > $error = $@; > croak $error if $@; > -----end code---- > > The error message I got was > "Can't locate object method "rand" via package "DBIx::Class::ResultSet" at..." > > Do you know how can I turn $dbic_schema->resultset("T") into an object of > type > DBIC::Schema::ResultSet::T or if there is a better approach? One can of course say instead -----start code---- my $resultset = $dbic_schema->resultset("T"); bless $resultset, 'DBIC::Schema::ResultSet::T'; my $row = $resultset->rand->single; -----end code---- and this works fine. It still feels like a hack, though. Do you have a better idea? Regards José _______________________________________________ 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/dbix-class@lists.scsys.co.uk