traffic control question

A

a

If I want to process the search result, I need to fill out the form, submit
and wait for the reply from the server before I process the search result.
I would like to add some traffic control to it, like writing a loop to wait
for the $response -> is_success, then break the loop. It may need to pass
the token to the OS for receiving the success message. How can I do it?
Thanks

e.g
my $ua = LWP::UserAgent -> new;
my $response = $ua->post(
"website.cgI",
[
textform => "search value"
]
);
#loop wait for is_success
if ($response -> is_success){
print $response -> status_line;
}
#loop
 
J

J. Gleixner

a said:
If I want to process the search result, I need to fill out the form, submit
and wait for the reply from the server before I process the search result.

How else would you process the result if you don't wait for the reply?
I would like to add some traffic control to it, like writing a loop to wait
for the $response -> is_success, then break the loop.

You don't need to "loop", you simply wait for the response. The request
will succeed or fail.

Post the request.
Wait for success/failure.
if success, do something else
else it's a failure, do something else
It may need to pass
the token to the OS for receiving the success message. How can I do it?

What the heck is "the token"?

Give us some code with more of what you're wanting to do.
 

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

Forum statistics

Threads
474,200
Messages
2,571,046
Members
47,646
Latest member
xayaci5906

Latest Threads

Top