Connection libraries Curl (CentOS, Red Hat)

In particular will be installing Curl for Perl
Install curl from the repository, YUM
# yum install curl-devel
# yum install curl
Next, run the installer for Perl modules
# perlMCPAN-e shell
If CPAN is not configured, it will ask you to configure it, click anywhere to Enter when you reach the region and the country, think and choose appropriate there (I have chosen Europe, Russia) and later the first repository.
After Setup is complete, you will be taken to the Shel CPAN:
CPAN > i/WWW-Curl/
See what modules are installed, the issue in this way:
CPAN: Storable loaded ok (v2.15)
Going to read/root/.cpan/Metadata
Database was generated on Sun, 03 May 2009 23:26:57 GMT
Distribution ANDREMAR/WWW-Curl-Simple-0.03.tar.gz
Distribution SZBALINT/WWW-Curl-4.06.tar.gz
CPAN install SZBALINT/WWW-Curl-4.06.tar.gz >
Click anywhere to Enter;
The same installation system module understands and different syntax, for example:
CPAN install > WWW: Curl
That’s all the Setup for testing can verify this code, it will load and display the HTML code for the page

# Test script for Perl extension Curl::easy.
# Check out the file README for more info.
use strict;
use WWW::Curl::Easy;
my $url = “”;
print “Testing curl version “,WWW::Curl::Easy::version(),” “;
# Init the curl session
my $curl= WWW::Curl::Easy->new() or die “curl init failed! “;
# Follow location headers
# Add some additional headers to the http-request:
my @myheaders=(
“I-am-a-silly-programmer: yes indeed you are”,
“User-Agent: Perl interface for libcURL”
$curl->setopt(CURLOPT_HTTPHEADER, @myheaders);
$curl->setopt(CURLOPT_URL, $url);
sub body_callback {
my ($chunk,$context)=@_;
push @{$context}, $chunk;
return length($chunk); # OK
$curl->setopt(CURLOPT_WRITEFUNCTION, &body_callback);
my @body;
$curl->setopt(CURLOPT_FILE, @body);
if ($curl->perform() != 0) {
print “Failed ::”.$curl->errbuf.” “;
# Cleanup is automatic
print join(“”,@body);