Thread FTP mit Perl (21 answers)
Opened by Rafael at 2006-09-11 13:39

Rafael
 2006-09-11 16:40
#69666 #69666
User since
2006-07-26
22 Artikel
BenutzerIn
[default_avatar]
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
28
29
30
#!/usr/bin/perl

use strict;
use warnings;
use Net::FTP;

my $host = "";
my $user = "";
my $pass = "";
my $option = 0;
my $option_2 = 0;
my $ftp = "";

print "Bitte wählen Sie: \n1 Anonymer Login \n2 Eingabe von Benutzerdaten \nIhre Wahl: ";
$option = <STDIN>;
if ($option == 1){
$user = "anonymous";
$pass = "anonymous\@anonymous.com";
};
if ($option == 2){
print "\nBenutzername: ";
$user = <STDIN>;
print "\nPasswort: ";
$pass = <STDIN>;
}
else {....};
print "\nHost: ";
$host = <STDIN>;
$ftp = Net::FTP->new($host);
$ftp->login($user, $pass);

Hier bekomme ich dann die Meldung:
Can't call method "login" on an undefined value D.\Perl\FTP\ftp.pl line 39. <STDIN> at line 2.\n\n

<!--EDIT|renee|1157980045-->

View full thread FTP mit Perl