Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I write a Perl script to use curl to process a URL?

Tags:

People also ask

How do you curl a URL?

The syntax for the curl command is as follows: curl [options] [URL...] In its simplest form, when invoked without any option, curl displays the specified resource to the standard output. The command will print the source code of the example.com homepage in your terminal window.

How do I run a curl command in Perl?

Using corion.net/curl2lwp.psgi , you can easily convert a Curl command line to a Perl script using LWP::UserAgent. The comment box is too small for the resulting code, but if that's what you're looking for, I can post it as answer.

What happens when you curl a URL from the command line?

cURL, which stands for client URL, is a command line tool that developers use to transfer data to and from a server. At the most fundamental, cURL lets you talk to a server by specifying the location (in the form of a URL) and the data you want to send.


I have a very simple task. I have a crontab that will run a script every hour. The script is meant to simply process a URL.

This is what I have. It doesn't work. I get a syntax error.

#!/usr/bin/perl
curl http://domain.com/page.html;

I haven't worked in Perl in years and wasn't very adept when I did.

SOLUTION

Thanks, Alex for pointing me to the correct path!

crontab

*/30 * * * * curl http://domain.com/path.html