in reply to $ftp not connecting to server

Hmmm ... creating a tmp file and exec'ing it isn't very perlish. Using what you have, your Net::FTP should look like this:

#!/usr/bin/perl use strict; use warnings; use Net::FTP; my $ftp = Net::FTP->new( "windows.ftp.server", Debug => 0 ) or die "Cannot connect to windows.ftp.server: $@"; $ftp->login( "userid","password" ) or die "Cannot login ", $ftp->message; $ftp->cwd( "/download" ) or die "Cannot change working directory ", $ftp->message; $ftp->get( $downFile, $ftpFile ) or die "get failed ", $ftp->message; $ftp->quit;
(and that's pretty much straight out of the docs).

-derby

Replies are listed 'Best First'.
Re^2: $ftp not connecting to server
by IronCore (Initiate) on Oct 09, 2009 at 21:56 UTC

    derby,
    I tried your code and it failed to connect.
    Do I have to define the server to windows somewhere?
    Like with ODBC for databases.
    I put my mainframe server name (which is an alias) in your code and it does connect.
    I'm a mainframer who has been forced at gun point to dance on the small platform side :-) so i'm not familiar with all of the ins and outs of window.
    thanks.

      IronCore the windows server name needs to resolve and there needs to be an ftp server running there. Have you tried connecting to the machine with a normal ftp client?

      -derby

        derby,
        shees I found the problem, I need to ftp through our proxy server.
        Once I did that perl ftp work just fine.
        Thanks a lot for your help.

        derby,
        I tried pinging the server and it times out. I'm missing something.

Re^2: $ftp not connecting to server
by IronCore (Initiate) on Oct 09, 2009 at 22:14 UTC

    derby,
    I forgot to respond to your tmp file comment.
    The program that sample came from is used to ftp many different files depending on passed parms.
    If there's a cleaner way to do it I'm certainly open to it.
    I do need to save the ftp output messages to a file though.
    thanks,