Win32::Internet fetch url question

E

EL34

I have an app that goes out to my company web site and checks a file to

see if an order has been placed on my shopping cart.

Everything works fine unless the server is down, is being re-booted,
etc.


My perl app hangs up and I cannot exit it unless I kill the Perl
process in windows.


I am using fetch to open the file.
$INET->FetchURL("$FileOnServer");


Is there a way to
see if a files exist on a server or if,
if the internet connection is down or,
any sort of reason why Perl cannot fetch the file within say 10
seconds?


I looked over the win32::internet docs but I don't quite understand how

to go about doing this.
a short example would be much appreciated.
thanks
 
J

J. Gleixner

EL34 wrote:
[...]
I am using fetch to open the file.
$INET->FetchURL("$FileOnServer");

Next time, show the code that creates $INET.

Is there a way to
see if a files exist on a server or if,
if the internet connection is down or,
any sort of reason why Perl cannot fetch the file within say 10
seconds?


I looked over the win32::internet docs but I don't quite understand how

to go about doing this.
a short example would be much appreciated.

Maybe you should look through the documentation for Win32::Internet,
instead. :)

I've never used it, however I took a few seconds and searched the
documentation for 'timeout', and found a 'ConnectTimeout' method. That
should provide you with a solution.
 
E

EL34

Thanks, but that one line does it all, there is no other code exept
Use::win32::internet.

I was kind of looking for someone who was familiar with the module and
an example, as I stated above.

Please don't get Po'd but your answer was of no help.


J. Gleixner said:
EL34 wrote:
[...]
I am using fetch to open the file.
$INET->FetchURL("$FileOnServer");

Next time, show the code that creates $INET.

Is there a way to
see if a files exist on a server or if,
if the internet connection is down or,
any sort of reason why Perl cannot fetch the file within say 10
seconds?


I looked over the win32::internet docs but I don't quite understand how

to go about doing this.
a short example would be much appreciated.

Maybe you should look through the documentation for Win32::Internet,
instead. :)

I've never used it, however I took a few seconds and searched the
documentation for 'timeout', and found a 'ConnectTimeout' method. That
should provide you with a solution.
 
E

EL34

Use::win32::internet.
$INET = new Win32::Internet();
$INET->FetchURL("$FileOnServer");

Actually, here's all that's required to fetch an URL.
Anyone have a simple working example of using the http session seesion
code and a way to test if the page can be fetched?
I'm not sure what I am looking at in the doc's as I stated above.


Thanks, but that one line does it all, there is no other code exept
Use::win32::internet.

I was kind of looking for someone who was familiar with the module and
an example, as I stated above.

Please don't get Po'd but your answer was of no help.


J. Gleixner said:
EL34 wrote:
[...]
I am using fetch to open the file.

Next time, show the code that creates $INET.

Is there a way to
see if a files exist on a server or if,
if the internet connection is down or,
any sort of reason why Perl cannot fetch the file within say 10
seconds?


I looked over the win32::internet docs but I don't quite understand how

to go about doing this.
a short example would be much appreciated.

Maybe you should look through the documentation for Win32::Internet,
instead. :)

I've never used it, however I took a few seconds and searched the
documentation for 'timeout', and found a 'ConnectTimeout' method. That
should provide you with a solution.
 
J

J. Gleixner

EL34 wrote:

Please stop top-posting....
J. Gleixner said:
EL34 wrote:
[...]
I am using fetch to open the file.

Next time, show the code that creates $INET.


Is there a way to
see if a files exist on a server or if,
if the internet connection is down or,
any sort of reason why Perl cannot fetch the file within say 10
seconds?


I looked over the win32::internet docs but I don't quite understand how

to go about doing this.
a short example would be much appreciated.
Maybe you should look through the documentation for Win32::Internet,
instead. :)

I've never used it, however I took a few seconds and searched the
documentation for 'timeout', and found a 'ConnectTimeout' method. That
should provide you with a solution.

EL34 said:
Thanks, but that one line does it all, there is no other code exept
Use::win32::internet.

Well, there's your problem.

It seems to be clearly spelled out in the documentation, I don't
need to be familiar with the particular module, if it's well
documented.

Why would I be "Po'd" that I point you right to the method you
need to resolve your stated issue and you say I was no help?
Use::win32::internet.
use Win32::Internet;

See, this stuff is important. If that's wrong then the one
line from you're script doesn't help anyone figure out
the problem.
$INET = new Win32::Internet();
$INET->FetchURL("$FileOnServer");

Actually, here's all that's required to fetch an URL.
Anyone have a simple working example of using the http session seesion
code and a way to test if the page can be fetched?
I'm not sure what I am looking at in the doc's as I stated above.

So you looked at the documentation and found ConnectionTimeout and that
didn't help disconnect the connection after a certain amount of time
waiting? I don't see that in your code.

You could also look at the test code that comes with that module,
which I found conveniently located on CPAN.

http://search.cpan.org/src/JDB/libwin32-0.26/Internet/test.pl

The "GENERIC URL FETCHER" part...

It's amazing the helpful things you find in the documentation.. :)

Now, if you come back for more, after that, and top-post your 3-line
script saying "It didn't work", then I'll get "Po'd".

Thank You
 
J

J. Gleixner

J. Gleixner said:
See, this stuff is important. If that's wrong then the one
line from you're script doesn't help anyone figure out
^^^^^^ your

pet-peeve.. to correct my own grammar. :)
 
E

EL34

You are a little too anal.

Please do not reply to messages if you are not familiar with the module
or have no intent on supplying the requested info. Bot sure why you are
you even involved in this post?

The best way I learn is from a working example.
This is not an unreasonable request to ask for a working example.
The HTTP sesion docs on this module do not have a working example and I
have searched the web looking for one.

Just because you have a better understanding of Perl than me does not
make you king shit on turd island. I am an expert on several other
fieldss other than Perl, I am just learning Perl.
Lets pretend you want to know something that I know on one of my fields
of expertise

I would not treat people the way that you do in my particular fields of
expertise.

RTFM is not what I was asking for in my original post.
 
J

J. Gleixner

EL34 said:
You are a little too anal.
And you're a three time top-poster. Not that I'm actually counting, or
anything.
Please do not reply to messages if you are not familiar with the module
or have no intent on supplying the requested info. Bot sure why you are
you even involved in this post?

What Bot??.. you? When you start paying me, I'll spit out the code,
until then start reading and trying things on your own time.
The best way I learn is from a working example.

I provided a link to a complete, working example. Did you bother
clicking on it before spouting off? Didn't think so..
This is not an unreasonable request to ask for a working example.
The HTTP sesion docs on this module do not have a working example and I
have searched the web looking for one.

No idea what an HTTP sesion is, maybe that's the problem area. Care to
elaborate?
Just because you have a better understanding of Perl than me does not
make you king shit on turd island.

It seems that you have that island all to your self.
I am an expert on several other
fieldss other than Perl, I am just learning Perl.

Where, exactly, did it seem like that was the case? It's documented and
I provided the exact method along with a link directly to a
very good example, one that's used to test the class. I guess it's
true, you're not an expert on following helpful advice. Oh well.
Lets pretend you want to know something that I know on one of my fields
of expertise

Nah, I grew out of pretending when I was about 6 years old, but you go
ahead and pretend all you want. xyzzy.. said:
I would not treat people the way that you do in my particular fields of
expertise.

No, thank you so much for not trying to help anyone. You're
obviously too busy pretending you know something to be bothered.
I'll sleep much better at night.
RTFM is not what I was asking for in my original post.

Too bad. Thanks for playing. Game over. Please insert another token..

bu-bye.. Plonk
 
T

Tad McClellan

EL34 said:
You are a little too anal.


And you are a little too dense.

Please do not reply to messages


I think you can probably count on plenty of people not replying
to your future messages, probably because they will not see them
in the first place...

if you are not familiar with the module
or have no intent on supplying the requested info.


There is no obligation for followups to fulfill any request.

We discuss Perl here, whether it provides what you want or
not is immaterial.

I am an expert on several other
fieldss other than Perl


I am impressed.
 
E

EL34

Just relax and forget about it, I found a lovely forum where people
actually are willing to help a beginner instead of just spewing out,
RTFM.

You can go back to your throne now and rejoice in how wonderful your
are that you understand Perl better than me.

For future refernce, some people learn better by seeing a working
example. Me for one.

Text book formulas without an examples are way more difficult and
impossible in some cases.

All I was asking for was a working example, nothing more.

see ya
 
J

Joe Smith

EL34 said:
All I was asking for was a working example, nothing more.

The reply dated 11/10/2006 12:59 PM did have a link
to a working example, so there was no need for obscenities.
RTFM is not what I was asking for in my original post.

However, if TFM has the exact answer to the question, then
referring to it is appropriate.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top