Thread Ausgabe umleiten: Aus einem Skript heraus sollen .... (7 answers)
Opened by raprezent at 2006-03-07 16:20

bloonix
 2006-03-07 16:42
#63573 #63573
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
Hallo raprezent,

du kannst auch Net::FTP verwenden. Hier ein Anwendungs-
beispiel:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use strict;
use warnings;
use Net::FTP;

my $server     = "Server";
my $user       = "User";
my $password   = "Password";
my $localfile  = "Localdir/Localfile";
my $remotefile = "Remotedir/Remotefile";

print "connecting to server $server ... ";
my $ftp = Net::FTP->new($server) or die $!;
print "ok\n";

print "login ... ";
$ftp->login($user,$password) or die $!;
print "ok\n";

print "changing to binary mode ... ";
$ftp->binary or die $!;
print "ok\n";

print "transfer $remotefile ... ";
$ftp->put($localfile,$remotefile) or die $!;
print "ok\n";

$ftp->quit;


Greez,
opi

Edit (Umleitung Beispiele):

my $workdir = $ftp->pwd or die $!;
my @list = $ftp->dir("Verzeichnis") or die $!;\n\n

<!--EDIT|opi|1141742772-->
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.

View full thread Ausgabe umleiten: Aus einem Skript heraus sollen ....