Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LWP and download directory

Status
Not open for further replies.

eatr

Technical User
Jan 20, 2006
48
Trying to automate LWP to download some files

here's the code in question:

@args = ("lwp-download", " "C:\Documents and Settings\Administrator\Desktop\$trackdate.pdf");
system(@args) == 0
or die "system @args failed: $?"


I'm in the 'PERL' directory and want to download the files to another directory: C:\Documents and Settings\Administrator\Desktop\$trackdate.pdf";

as written, the correct file is downloaded to the PERL DIRECTORY an named: Documents and Settings\Administrator\Desktop\$trackdate.pdf

how would I get the file to download in the proper directory and get the proper name?
 
Code:
@args = ("lwp-download", "[URL unfurl="true"]http://drf.com/drfPDFChartRacesIndexAction.do?filename=$filename",[/URL] 'C:[COLOR=red]/[/color]Documents and Settings[COLOR=red]/[/color]Administrator[COLOR=red]/[/color]Desktop[COLOR=red]/[/color]$trackdate.pdf');

using the LWP modules directly would give you greater granularity FWIW

HTH

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
thanks, I've been looking at the LWP & Perl book but there's so much work through

as for the code above

it works but names the file literally ($trackdate.pdf) rather

than interpretatively (there's a value to this variable that's passed in at the command line.)

I've played with inserting double quotes around the variable name but nothing happens

thanks
 
'C:/Documents and Settings/Administrator/Desktop/'.$trackdate.'.pdf');
or
"C:/Documents and Settings/Administrator/Desktop/$trackdate.pdf");

sorry about that

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
thanks

the first option gets it done
 
you're welcome ...

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top