Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: LWP help

by hnd (Scribe)
on Jun 27, 2009 at 12:07 UTC ( [id://775298]=note: print w/replies, xml ) Need Help??


in reply to Re: LWP help
in thread LWP help

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^3: LWP help
by mzedeler (Pilgrim) on Jun 27, 2009 at 12:32 UTC

    Short answer: no.

    LWP doesn't return the document you request, but a response object which - in turn - has an attribute with the content. There is an example on the main documentation page of LWP.

    LWP will fetch anything you ask it to fetch for you, and let you access it using the content attribute - regardless of what it fetched for you. With regard to your idea about regular expressions: it doesn't work that way - try playing around with LWP a little first.

    By the way: I think you'll be able to ask much better questions if you try things by yourself first, and ask later.

Re^3: LWP help
by bart (Canon) on Jun 28, 2009 at 09:27 UTC

    Perhaps you should try to use LWP::Simple instead... it will indeed work almost as your made up example. It won't tell you the content-type... but do you really need it? I rarely do.

    Use:

    • get to retrieve the contents of a URL into a variable
    • getprint to print the contents of URL, without having to pull it into memory first (saves memory if it's huge)
    • getstore to save the contents of a URL directly to file, without holding it in memory first.
      thanks bart that thing worked!!!!!!!!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-24 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found