#!/usr/local/bin/perl my $VERSION = "1.02"; my $AUTHOR = "Prilusky"; my $YEAR = "2009"; # usage getPDBfile PDBid PDBid PDBid # retrieves PDB files and stores them in the current directory use LWP::Simple; my @ids = @ARGV; die "\nUsage: $0 PDBid PDBid\n\n" if ($ARGV[0] =~ /^ *$/); $ENV{'http_proxy'} = "http://wwwproxy.weizmann.ac.il:8080"; $ENV{'no_proxy'} = "weizmann.ac.il"; foreach $id (@ids) { my $pdbfile = $id . "\.pdb"; my $status = mirror("http://oca.weizmann.ac.il/oca-bin/save-pdb?$id",$pdbfile); if (-z $pdbfile) { print "Unable to retrieve $pdbfile\n"; unlink($pdbfile); } else { print "Retrieved $pdbfile\n"; } }