Subscribe to the RSS feed for the devdaily.com blog
Page not found (404 error) | alvinalexander.com

Page not found (404 error)

I’m sorry, the URL you are looking for can't be found.

This may be because I’ve made several significant changes to the website lately. If you want to take a few moments to search for the document you were looking for, you can try the Search Page here.

(I am trying to fix all the links I have broken, but it takes time.)

Thank you for your patience, and have a nice day!

Alvin Alexander
Owner, Editor, Link-breaker, Repairman,
AlvinAlexander.com


What is the easiest way to download the contents of a URL with Perl?

Question: What is the easiest way to download the contents of a URL with Perl?

Answer:

The easiest way I know to download the contents of a URL (i.e., "http://...") with Perl is to use the libwww-perl library, LWP.pm.

Once you have that module installed, the easiest code is this:

#!/usr/bin/perl

use LWP::Simple;
$url = get 'http://www.DevDaily.com/';

At this point the variable $url contains the contents of the URL you specified. From here you can print the URL, or otherwise manipulate it in your program.

For many other options, see the LWP.pm module and lwpcook.pod documentation.

What's Related


devdaily logo