From: Joost Diepenmaat on
Winston75 <baptiste.fevre(a)gmail.com> writes:

> Ok :
>
> getstore ($url, $filename);
> print $!;
>
> Result --> bade file descriptor !!

The value of $! doesn't mean anything unless you know that the last IO
operation that occorred resulted in an error. You don't know that here.

Looking at the docs for LWP::Simple, seems you need something like this:

my $rc = getstore($url,$filename);
if (is_error($rc)) {
die "Some error occurred: $rc";
}


--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
From: Peter Makholm on
Winston75 <baptiste.fevre(a)gmail.com> writes:

> getstore ($url, $filename);
> print $!;

Only assume that $! is relevant if the documentation says so, and even
when the documentation says that it is relevant it is almost always if
the called function signals an error in some way.

//Makholm
From: Winston75 on
On 24 avr, 18:09, Peter Makholm <pe...(a)makholm.net> wrote:
> Winston75 <baptiste.fe...(a)gmail.com> writes:
> > getstore ($url, $filename);
> > print $!;
>
> Only assume that $! is relevant if the documentation says so, and even
> when the documentation says that it is relevant it is almost always if
> the called function signals an error in some way.
>
> //Makholm


Ok thanks, my results :

downloading file1.zip....Failed with response code 404
downloading file2.zip....Failed with response code 404
downloading file3.zip....Failed with response code 404
From: RedGrittyBrick on
Winston75 wrote:
> On 24 avr, 18:09, Peter Makholm <pe...(a)makholm.net> wrote:
>> Winston75 <baptiste.fe...(a)gmail.com> writes:
>>> getstore ($url, $filename);
>>> print $!;
>> Only assume that $! is relevant if the documentation says so, and even
>> when the documentation says that it is relevant it is almost always if
>> the called function signals an error in some way.
>>
>> //Makholm
>
>
> Ok thanks, my results :
>
> downloading file1.zip....Failed with response code 404
> downloading file2.zip....Failed with response code 404
> downloading file3.zip....Failed with response code 404

404 means the URL is incorrect - there's no page with that path.

I'd change the print statement from
print "downloading $fileName....";
to
print "downloading $fileName from '$url' ....";

I expect that will identify the problem.

--
RGB
From: Chris Mattern on
On 2008-04-24, Winston75 <baptiste.fevre(a)gmail.com> wrote:
> On 24 avr, 18:09, Peter Makholm <pe...(a)makholm.net> wrote:
>> Winston75 <baptiste.fe...(a)gmail.com> writes:
>> > getstore ($url, $filename);
>> > print $!;
>>
>> Only assume that $! is relevant if the documentation says so, and even
>> when the documentation says that it is relevant it is almost always if
>> the called function signals an error in some way.
>>
>> //Makholm
>
>
> Ok thanks, my results :
>
> downloading file1.zip....Failed with response code 404
> downloading file2.zip....Failed with response code 404
> downloading file3.zip....Failed with response code 404

"Quoth the server, 404.
That file, it don't exist no more."


--
Christopher Mattern

NOTICE
Thank you for noticing this new notice
Your noticing it has been noted
And will be reported to the authorities