----- Original Message ----- 
From: Dhanashri Bhate <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>, <beginners@perl.org>
Sent: Thu, 22 Dec 2005 13:24
Subject: Fwd: RE: WWW::Mechanize, save images from a page



Well,
All I have to say is that my basic understanding of perl language and how to
download a link may be very little, and probably I do need a tutor as you
said!

But I'm not here to spoil any domain reputation. My query was a genuine one!
And I'm really surprised to get this reply :(  

I didn't say that you were out to do that.  Since you certainly surprised me, it
left me wondering what in the world was up.  So I asked some questions.  Ok
perhaps it was towards flippant of me to ask about regard to domain reputation. 
I'll own that.  But that's all that I'll own.

I only asked given my concern that if enough certain type of posts over time 
were
to originate from (well, you get the idea).  Perhaps leaned toward bad taste
though.  Didn't mean for that.  Meant well but didn't do it right.  Sorry.

Well, you certainly surprised me given the direction you went with the code.  
So,
what do ya expect?  A surprise equates to a surprise in both directions back and
forth.

Maybe next time something like this happen on list, I'll ignore, not reply, let
someone else have the opportunity instead as it puzzles me and I don't know how
to reply.

It is also possible for the one asking for help to help out by what and how 
they ask.

Glad you got it working.  Curl obviously downloads too.

Anyway, about downloading a link, all I had done earlier is use
WWW::Mechanize, get($url) and then use function save_content to save it in a
file, which works very well.
I had used it earlier to get a ZIP file, the file was downloaded but could
not be opened. That was the time when someone on this same list (sorry! I
don't remember the name) had suggested using binary copy instead of using
the save_content function. 
That worked, and since this image I want to save is also not a text file, I
followed the same approach. 

But, in the code I posted I had missed a very important line $mech->get (
$url ) , before the starting the binary copy. After adding this line the
script works perfectly fine.

Oh, ok.  that's what caused my surprise.  that line was missing from the post of
yours that I saw.  that explains it then.  had I seen that line I then would 
have
known immediately what was going on and would not have responded at all like I
did.  I didn't know that the pic file could be brought in in that way.  but that
critcal (the missing) line gives the whole thing away, makes me immediately
understand.

ok I asked the wrong questions that time.  but, alas, a typo (missing line of
code) you discover it yourself.  What does all of this tell us?  is there a 
story
in this?

I do those/these same sorts of things too.  but since I know that about myself, 
I
resist the temptation to post early before I've gone over my code a zillion 
times
and by then I've usually ruled out oversights/typos on my part prior to posting.
 but, yes I've posted with oversight/typo before, more than once.

good luck.

-- 
Alan.



---- Msg sent via CWNet - http://www.cwnet.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to