Current Perl documentation can be found at

Here is our local, out-dated (pre-5.6) version:

One approach, if you have the lynx text-based HTML browser installed on your system, is this:

    $html_code = `lynx -source $url`;
    $text_data = `lynx -dump $url`;

The libwww-perl (LWP) modules from CPAN provide a more powerful way to do this. They work through proxies, and don't require lynx:

    # simplest version
    use LWP::Simple;
    $content = get($URL);

    # or print HTML from a URL
    use LWP::Simple;
    getprint "";;

    # or print ASCII from HTML from a URL
    use LWP::Simple;
    use HTML::Parse;
    use HTML::FormatText;
    my ($html, $ascii);
    $html = get("";);
    defined $html
        or die "Can't fetch HTML from";;
    $ascii = HTML::FormatText->new->format(parse_html($html));
    print $ascii;