cURL / Mailing Lists / curl-library / Single Mail

curl-library

stderr - access violation

From: O'Loughlin, Anthony (MED US) <anthony.oloughlin_at_siemens.com>
Date: Wed, 9 Apr 2008 13:37:42 -0400

I've looked at the manual for using stderr and verbose. This snippet of
code creates the file (err.txt). However it is empty and the code access
violates.
 
What I'm I missing? Thanks, Tony
 
 
use Curl::easy;

# Variables
my $address = 'ftp://xxx/ <ftp://xxx//> yy';
my $login = '****'
my $password = '****

# Init the curl session
my $curl = WWW::Curl::Easy->new();

# Verbose debugging
$curl->setopt(CURLOPT_VERBOSE, 1);

# Set curl parameters
$curl->setopt(CURLOPT_URL, $address);
$curl->setopt(CURLOPT_USERPWD, $login.':'.$password);

open ERRFH, ">err.txt";
$curl->setopt(CURLOPT_STDERR, *ERRFH);

$curl->setopt(CURLOPT_UPLOAD, 1);
open FILE, ">FileSend.txt";
$curl->setopt(CURLOPT_INFILE, *FILE);

$curl->perform();
 
close FILE;
 

----------------------------------------------------------------------------
This message and any included attachments are from Siemens Medical Solutions
and are intended only for the addressee(s).
The information contained herein may include trade secrets or privileged or
otherwise confidential information. Unauthorized review, forwarding, printing,
copying, distributing, or using such information is strictly prohibited and may
be unlawful. If you received this message in error, or have reason to believe
you are not authorized to receive it, please promptly delete this message and
notify the sender by e-mail with a copy to Central.SecurityOffice_at_siemens.com

Thank you
Received on 2008-04-09