PDA

View Full Version : LWP questions


Del
11-09-1998, 06:29 AM
Okay, I know I can grab the title of a page by using $response->title() (well, it's $response for me anyway *s*). Is there some similar way of grabbing the meta keyword and description tags too? Or do I have to build a regular expression (or two) to get that kind of info?

I've read through every file in the lwp download (the hard way, via my editor hehehe), and didn't really find anything that answers my question. Still piddling thru the Unix for Dummies book learning what to do with telnet hehehe.

Also, is LWP what I'd use to do the file transfer from one server to another? (Similar to a browser upload, only different. Think I know how to pull it off, just wanna double check.)

Finally, on the server->server transfer thing, can I transfer an image the same as a text(ish) file? For example,

$newimg = "$stuff grabbed from LWP Get request";

open(IMG,">/blah/image.gif");
print IMG $newimg;
close(IMG);

Thanks in advance,
Del

Terra
11-09-1998, 06:59 AM
The LWP is a breath taking work of art -- as is the CGI library...

Eeeeeshhhhh: $response->
you actually type all that... my fingers would fall off... :p

I learned a lot about the LWP by looking at several of the programs like "lwp-download", "lwp-mirror", "lwp-request", and "lwp-rget"...

This is a Swiss Army knife for any type of HTTP or FTP interaction...

Both the LWP and CGI do the file upload for browsers, but use different methods to do so - so be aware of that...

For online information on this powerful library -- goto http://www.sn.no/libwww-perl/

There is also a "lwpcook" man page...
RTFM... http://www.aota.net/ubb//smile.gif
$man LWP
$man lwpcook
$man CGI
for telnet sessions...

Personally - I just go to their respective web pages while working on the other monitor while I code...

In Linux, a file is a file -- text files and binary files are both treated the same... So the slurped $newimg would print just fine...

--
Terra
--yesterday is only 24 hours away-- AG'98'TT