>>>>> "Marcus" == Marcus Brito <[EMAIL PROTECTED]> writes:

Marcus> A quick question to LWP designers: what was the motivation for making
Marcus> the redirect_ok a method, instead of a property?

Marcus> When a developer wants to make a single request using a different
Marcus> behavior than the default, and s/he must subclass UserAgent. Isn't
Marcus> this too overkill? I can think of a few situations where subclassing
Marcus> UserAgent would be actually better.

Marcus> Wouldn't it be so much simpler if one could do something like this:

Marcus> $req = HTTP::Request->new('GET', 'http://www.some-host.com');
Marcus> $req->redirect_ok = 0;

Marcus> or

Marcus> $req = HTTP::Request->new('POST',
Marcus> 'http://www.some-host.com/someform.php', [name1 => value1]);
Marcus> $req->redirect_ok = 1;

Every place I formerly wanted to override redirect_ok, I now just use
simple_request instead of request, and it works so much easier!

Does that help?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to