develooper Front page | perl.libwww | Postings from January 2002

Need Help On Using LWP::Simple

Thread Next
From:
Weifeng Wang
Date:
January 23, 2002 11:15
Subject:
Need Help On Using LWP::Simple
Message ID:
BIEAIMIOBNGFEBGGFIJPCEINCAAA.Weifeng.Wang@bioinfogroup.com
Hi There,

Thank you very much for all the responses on my previous question on
installation of libwww module.  It looks like that it is hard to compile a
module without cc compiler when the original Perl was built with cc.  So, I
installed the libwww module on my Linux machine instead of Solaris server.
But, when I used the following Perl script I got the empty, i.e. 0 byte,
files downloaded.  I am wondering whether my Perl script is wrong since I
can manually download the files through web pages.  I would appreciate if
someone can give me a help.  Thank you very much in advance.

Weifeng Wang
Bio-Informatics Group, Inc.
2000 Regency Parkway, Suite 395
Cary, NC 27511
Tel: (919)380-1862

********************************************************
use LWP::Simple;
@CMS=(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,"X","Y","Un")
;
foreach $CM (@CMS)
{
 if (($CM < 10) & ($CM > 0)){$CM1="0".$CM} else {$CM1=$CM};
 $URL1 =
"ftp\:\/\/ncbi.nlm.nih.gov\/genomes\/H\_sapiens\/CHR\_".$CM1."\/hs\_chr".$CM
.."\.gbs\.gz";
 $filename1 ="\/home\/share\/hs_chr".$CM."\.gbs\.gz";
 open (out1, ">$filename1") or die;
 print ("$URL1\n");
 getstore ($URL1, $filename1);

 $URL2 =
"ftp\:\/\/ncbi.nlm.nih.gov\/genomes\/H\_sapiens\/CHR\_".$CM1."\/hs\_chr".$CM
.."\.fa\.gz";
 $filename2 ="\/home\/share\/hs_chr".$CM."\.fa\.gz";
 open (out2, ">$filename2") or die;
 print ("$URL2\n");
 getstore ($URL2, $filename2);
}


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About