in reply to Re^3: Iterating through DBIx resultset
in thread Iterating through DBIx::Class resultset

I just changed it to this instead. Do you think I still need to iterate to last page? :
my $max_records = ''; GetOptions("max_records=i" => \$max_records) or die ("Error in command line arguments\n"); my @results = My::App::Schema->schema->resultset('MyTable')->search( undef, { page => 1, rows => $max_records, } ); for my $result ( @results ) { ### Processing Domain ID: ($result->id) print $result."\n"; }
Also, is irc.perl.org on freenode?

Replies are listed 'Best First'.
Re^5: Iterating through DBIx resultset
by stonecolddevin (Parson) on Jul 07, 2014 at 16:54 UTC

    I think you need to call ->all:

    my @results = My::App::Schema->schema->resultset('MyTable')->search( undef, { page => 1, rows => $max_records, } )->all;

    irc.perl.org is the IRC server. So you'd connect to it like you would connect to freenode and /join the #dbix-class channel.

    Three thousand years of beautiful tradition, from Moses to Sandy Koufax, you're god damn right I'm living in the fucking past

      I think that worked without using  ->all but I did use 'all' for another part of my script..
      And thanks for the irc reference :)

        I haven't used DBIC in some time, but I think ->all might be inferred when you do ->search(...) in list context. Glad you got it working.

        Three thousand years of beautiful tradition, from Moses to Sandy Koufax, you're god damn right I'm living in the fucking past