aboutsummaryrefslogtreecommitdiff
path: root/perl/Curl_easy/examples
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-10-01 07:44:12 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-10-01 07:44:12 +0000
commit91275548528859f882c87c2131d3c96a0abd5938 (patch)
tree791ad8ca8040d3555267bdbff267148362825bd9 /perl/Curl_easy/examples
parent9ff28a823702781f7e90cd44f31032a453827e7a (diff)
moved to the perl module
Diffstat (limited to 'perl/Curl_easy/examples')
-rw-r--r--perl/Curl_easy/examples/basicfirst.pl48
1 files changed, 0 insertions, 48 deletions
diff --git a/perl/Curl_easy/examples/basicfirst.pl b/perl/Curl_easy/examples/basicfirst.pl
deleted file mode 100644
index a04deb515..000000000
--- a/perl/Curl_easy/examples/basicfirst.pl
+++ /dev/null
@@ -1,48 +0,0 @@
-# Test script for Perl extension Curl::easy.
-# Check out the file README for more info.
-
-use strict;
-use Curl::easy;
-
-my $url = "http://curl.haxx.se/dev/";
-
-print "Testing curl version ",&Curl::easy::version(),"\n";
-
-# Init the curl session
-my $curl= Curl::easy::init();
-if(!$curl) {
- die "curl init failed!\n";
-}
-
-# Follow location headers
- Curl::easy::setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
-
-# Add some additional headers to the http-request:
-my @myheaders;
-$myheaders[0] = "I-am-a-silly-programmer: yes indeed you are";
-$myheaders[1] = "User-Agent: Perl interface for libcURL";
- Curl::easy::setopt($curl, Curl::easy::CURLOPT_HTTPHEADER, \@myheaders);
-
-my $errbuf;
-Curl::easy::setopt($curl, CURLOPT_ERRORBUFFER, "errbuf");
-
-Curl::easy::setopt($curl, CURLOPT_URL, $url);
-
-sub body_callback {
- my ($chunk,$handle)=@_;
- push @$handle, $chunk;
- return length($chunk); # OK
-}
- Curl::easy::setopt($curl, CURLOPT_WRITEFUNCTION, \&body_callback);
-
-my @body;
- Curl::easy::setopt($curl, CURLOPT_FILE, \@body);
-
-if (Curl::easy::perform($curl) != 0) {
- print "Failed :$errbuf\n";
-};
-
-# Cleanup
- Curl::easy::cleanup($curl);
-
-print @body;