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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to ftp within a Perl script

Status
Not open for further replies.

banjopicker

Programmer
Jan 22, 2004
4
US
I am trying to execute a series of ftp commands within a perl script on windows. I thought this would be as easy as using DOS commands with 'system' commands. This does not seem to work and I get stuck at the first ftp step. I have also tried using ampersands as a continuation of the DOS commands but that does not work either. Below is the code I am using. Any feedback is greatly appreciated,
banjopicker


#!/usr/bin/perl -w
#####################################
# FTP in Perl
#####################################
use strict;
use warnings;


system ('ftp');
system ('open servername');
system ('username,password');


 
There is a perl FTP module on CPAN that we use for our scripts. I don't know if it works on windows or not, but it's probably worth a look.
 
On look for Net::FTP

with ActivePerl (Windows Perl) you should try installing via PPM as your first option

Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top