Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: NET::FTP Package

by Zitoune (Beadle)
on Nov 21, 2002 at 15:43 UTC ( #214791=note: print w/replies, xml ) Need Help??


in reply to NET::FTP Package

Here's the code

use Net::FTP; $G_FTP_SITE = &Config_Get("TOTAL_CARE FTP_SITE"); $G_FTP_USERNAME = &Config_Get("TOTAL_CARE FTP_USERNAME"); $G_FTP_PASSWORD = &Config_Get("TOTAL_CARE FTP_PASSWORD"); $ftp = Net::FTP->new( "$G_FTP_SITE" ); $ftp->login( "$G_FTP_USERNAME","$G_FTP_PASSWORD" ); $ftp->binary (); $ftp->put( "file.txt" ); $ftp->quit;

Replies are listed 'Best First'.
Re: Re: NET::FTP Package
by insensate (Hermit) on Nov 21, 2002 at 15:51 UTC
    Use strict.
    And trap for errors:
    use strict; my $ftp = Net::FTP->new( "$G_FTP_SITE" ) or die "Can't connect: $!"; $ftp->login( "$G_FTP_USERNAME","$G_FTP_PASSWORD" ) or die "Can't login +: $!; $ftp->binary () or die "Can't set mode to bin: $!";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://214791]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2020-11-27 17:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?