Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Iterating through DBIx resultset

by PerlSufi (Friar)
on Jul 02, 2014 at 17:31 UTC ( [id://1092027]=note: print w/replies, xml ) Need Help??


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

Awesome, stonecolddevin, that worked - Thank you. I'm not all that great at DBIx yet -but that cookbook was a better source than the normal docs.

Replies are listed 'Best First'.
Re^3: Iterating through DBIx resultset
by stonecolddevin (Parson) on Jul 02, 2014 at 17:36 UTC

    It's a bit of a bear, and the docs are definitely a jungle, but that cookbook is a great starting place. Jump on #dbix-class on irc.perl.org and you'll get a lot of good help figuring out things that aren't immediately intuitive.

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

      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?

        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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1092027]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-19 20:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found