Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^2: LWP help

by hnd (Scribe)
on Jun 27, 2009 at 12:07 UTC ( #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.


    • 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?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2022-01-23 06:52 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (63 votes). Check out past polls.