[ back to toc ]

update web contents

Date: 2002/02/20 10:08

Q:
Dear Peter

I run a short program in ActivePerl. Basically, it just goes to a web site
and get its web content, like this:

use Win32::Internet;
$INET = new Win32::Internet();
$INET->ConnectTimeout(10000);
$INET->ConnectRetries(10);
$INET->OpenURL($URL,"$myurl");
$fileText = $INET->FetchURL("$myurl");

This short code has to repeat after a period, say 1 minute. So the
function is to get web contents every one minute.

However, each time, I always get the same stuff. It seems I need some
function like FLUSH to update. Or maybe there is other way to do it.
Please help.

*NAME-DELETED*
A:
Dear *NAME-DELETED*,

I am not familiar with the Win32::Internet module. It may happen that the
module stores the page in a program cache and does not fetch the URL
again.

You could ask some one being more familiar with the module or read the
documentation of the module more deeply (though it may not be detailed
that much).

What I can suggest to use some Perl code that uses pure socket programming
and thus have total control over caching. To do that visit

http://peter.verhas.com/progs/perl/webmirror

and learn from the code, and copy paste from it if you like.

Regards,
Peter

*******************
Please take your time and rate me at AllExperts.com
I ask you to do that the way you believe I deserve.
This is a feedback that I get from allexperts but
it does not affect my life in any financial way. This
is just a mental feedback.

In case you think my answer was really good and if you feel
it appropriate do not hesitate to nominate me to volunteer
of the month.

I do this job volunteer in my free time and this is all I get
as compensation.

[ back to toc ]