Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

•Re: LWP::Simple and redirects

by merlyn (Sage)
on Feb 25, 2002 at 23:58 UTC ( [id://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.

    BlueLines

    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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (1)
As of 2024-04-24 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found