Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

•Re: LWP::Simple and redirects

by merlyn (Sage)
on Feb 25, 2002 at 23:58 UTC ( #147435=note: print w/replies, xml ) Need Help??

in reply to LWP::Simple and redirects

It normally works fine for me for sites that redirect, unless you've done something unusual. Can you give us the URL so we can trace down what's actually happening?

(And on second reading...) What would you possibly be looking at the content of what's coming back to locate a redirect? A redirect is in the headers, not the content, and LWP::Simple doesn't give you access to the headers.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: •Re: LWP::Simple and redirects
by BlueLines (Hermit) on Feb 26, 2002 at 01:06 UTC
    Actually, you can get some headers from LWP::Simple:
    head($url) Get document headers. Returns the following 5 values if succ +essful: ($content_type, $document_length, $modi­fied_time, $expires, +$server) Returns an empty list if it fails. In scalar context return +s TRUE if successful.
    although you cant get any headers with the get method. merlyn is right though; you should use LWP::UserAgent instead.


    Disclaimer: This post may contain inaccurate information, be habit forming, cause atomic warfare between peaceful countries, speed up male pattern baldness, interfere with your cable reception, exile you from certain third world countries, ruin your marriage, and generally spoil your day. No batteries included, no strings attached, your mileage may vary.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://147435]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2023-03-25 13:38 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (63 votes). Check out past polls.