kash650 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I've been trying for hours to see how to read the text from a webpage but can't find a proper solution. I've tried this, but it doesn't work. I just want to save the text to read it / directly read it

use IO::All; my $html < IO("hgdownload.soe.ucsc.edu/goldenpath/hg19/database:80");

Replies are listed 'Best First'.
Re: Access webpage
by marto (Cardinal) on Apr 04, 2013 at 23:00 UTC

    You could use a module such as WWW::Mechanize to access the page content. Looking at the page I note that they request you download large files via FTP. If this is Bio Informatics data look into BioPerl to see if there's an simpler more perlish way to achieve your goal. Perl and Bioinformatics

Re: Access webpage
by Loops (Curate) on Apr 04, 2013 at 23:32 UTC

    Howdy, your syntax is just a little off:

    use IO::All; my $html < io->http("http://hgdownload.soe.ucsc.edu/database:80");

    Note that the "io" is in lowercase, not upper as in your example. You also need the "->http" method, and "http://" prefix in your url.

    Also, you'll have to ensure that you have the IO::All::LWP module installed.

      The original URL is mangled:
      use IO::All; my $html < io->http("http://hgdownload.soe.ucsc.edu:80/goldenpath/hg19 +/database");
      The :80 needs to be after the domain name, but is redundant. It is only needed if it is not port 80.