I was trying to download a file from a web site http://www.ebi.ac.uk/thornton-srv/databases/cgi-bin/pdbsum/GetPage.pl?pdbcode=$pdb"
where $pdb is my var....and then I want to download a file postscript from a link...but when you try manually it ask if you want to save or see the file, so I cannot use wget command of linux...but using LWP::Simple and the mirror function it runs and below I give my codeuse LWP::Simple; print "write the name of the folder where you wanna save your file: "; my $Dir= <STDIN>; chomp ($Dir); if(!-e $Dir) { system "mkdir $Dir"; } if(!-w $Dir or !-d $Dir) { die "ERROR: Cannot access directory: '$Dir'. Exiting\n"; } print "write name of the path of that directory: "; my $path= <STDIN>; chomp ($path); my $pdb = <STDIN>; #if you wanna try use 1xmj... chomp ($pdb); my @files = (["http://www.ebi.ac.uk/thornton-srv/databases/cgi-bin/pdb +sum/RunLigplot.pl?pdb=1xmj&file=ligplot01_01", "/$path/$Dir/name_ +file.pl"]); for my $duplet (@files) { mirror($duplet->[0], $duplet->[1]); }
In reply to SOLVED:download a file from a web by paola82
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |