Leser: 1
|< 1 2 3 >| | 22 Einträge, 3 Seiten |
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);
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 = "";
my $login = "";
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>;
}
print "\nHost: ";
$host = <STDIN>;
$ftp = Net::FTP->new($host);
$ftp->$login($user, $pass);
Quote\n\nCan't call method "" on an undefined value at ftp.pl line 32, <STDIN> line 2.
Quoteeingebaut$ftp = Net::FTP->new($host, Debug => 0)
or die "Cannot connect to $host: $@";
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
31
32
33
34
35
36
#!/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 = "";
my $login = "";
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>;
chomp($user);
print "\nPasswort: ";
$pass = <STDIN>;
chomp($pass);
}
else {print "anonymous login selected\n"};
print "\nHost: ";
$host = <STDIN>;
chomp($host);
$ftp = Net::FTP->new($host, Debug => 0)
or die "Cannot connect to $host: $@";
$ftp->$login($user, $pass);
QuoteCannot connect to 127.0.0.1: Net::FTP: connect: Unknown error at ftp.pl line 34,
<STDIN> line 4.
|< 1 2 3 >| | 22 Einträge, 3 Seiten |