Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: Forking and shelling out to curl

by bliako (Monsignor)
on Mar 27, 2019 at 09:39 UTC ( [id://1231736]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Forking and shelling out to curl
in thread Forking and shelling out to curl

just for information: LWP::Protocol::Net::Curl interfaces libcurl with LWP methods. So if one has LWP-based script, can switch transparently to libcurl with this module.

btw, your script when daemonizes switches dir to /. Are you using absolute paths for your log and data files?

It would be better if you provided a simplified example script and complete, not fragments.

Replies are listed 'Best First'.
Re^5: Forking and shelling out to curl
by Argel (Prior) on Jan 11, 2020 at 00:15 UTC
    Yes, I was full pathing everything. I have access to a RHEL 7 server with a bunch of modules avaialble to me, so I'm using REST::Client, though I just found out it doesn't page data, so I;m back to hitting my head against a wall! :/

    Elda Taluta; Sarks Sark; Ark Arks
    My deviantART gallery

      REST::Client, though I just found out it doesn't page data, so I;m back to hitting my head against a wall! :/

      Hi,

      DBI doesn't page data either :) think about it

        DBI can (somewhat) page data, but of course you can only page forward. The following code fetches the results in batches of 10k rows:

        my $rows = []; # cache for batches of rows while( my $row = ( shift(@$rows) || # get row from cache, or reload +cache: shift(@{$rows=$sth->fetchall_arrayref(undef,10_00 +0)||[]}) ) ) { # do processing of row here ... }

        Of course, just because you're transferring the data from the DB driver to Perl space in batches of 10k doesn't mean that the database driver doesn't fetch all available rows onto your machine already.

        Data::Stream::Bulk wraps this approach in an(other) API, but I never got warm with it.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-24 00:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found