Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Couldn't figure out Perl's curl
September 6, 2015, 10:00 pm
rate this thread
I couldn't figure out Perl's curl.
This is what I am doing in Bash:
$ curl --max-time 20 --silent \
I *must* have to "--max-time" option. (Some of these web site,
I could not figure out how to do this with Perl's curl.
What did I miss?
- Mart van de Wege
September 7, 2015, 11:04 am
Re: Couldn't figure out Perl's curl
Use LWP::UserAgent, it has a 'timeout' parameter.
my $ua = LWP::UserAgent->new( timeout => 20 );
my $response = $ua->get('http://www.example.com ');
my $content = $response->content if $response->is_success;
"We will need a longer wall when the revolution comes."
--- AJS, quoting an uncertain source.