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-download from file

Status
Not open for further replies.

eatr

Technical User
Jan 20, 2006
48
Realize this is trivial for most but I'm just getting back to Perl.

How do I call lwp-download (or any Perl command line option) from a file instead of the command line?

Thanks
 
Write a batch file (it basically is a list of command-line commands within one file that you double-click and run)

Code:
@echo off
lwp-download ???

The @echo off removes the command echo, take this example:
Code:
echo Hello World!
echo.
pause

With echoing on, it would look like this in command prompt:
Code:
C:\WINDOWS\system32>echo Hello World!
Hello World!

C:\WINDOWS\system32>echo.


C:\WINDOWS\system32>pause
Press any key to continue . . .

With @echo off
Code:
Hello World!

Press any key to continue . . .

Anyway, any command-line commands you would send through the prompt, you can put inside the batch file, just open Notepad, type some commands in (one per line) and save it as a .bat file.
 
Thanks

Is it possible to call it from within a perl (.pl) file as part of a larger program?

 
You can use system() within Perl to send commands directly to the console of the system running the script.

Code:
system ("lwp-download ...");

# or if you wanted the output from the command,
# surround it in backticks ``
my $output = `lwp-download ...`;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top