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 code

use 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&amp;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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.