Thread Fehlermeldungen abfangen/unterdrücken: Use of uninitialized value in concatenat (17 answers)
Opened by Duff at 2007-05-27 19:16

Duff
 2007-05-28 14:43
#77000 #77000
User since
2006-10-06
283 Artikel
BenutzerIn

user image
Bekomme dann folgende Fehlermeldung:
Code: (dl )
1
2
3
4
5
ll at /home/daniel/scripts/select_db.pl line 32, <STDIN> line 1.
Use of uninitialized value in warn at /home/daniel/scripts/select_db.pl line 32, <STDIN> line 1.
Warning: something's wrong at /home/daniel/scripts/select_db.pl line 32, <STDIN> line 1.
Use of uninitialized value in concatenation (.) or string at /home/daniel/scripts/select_db.pl line 33, <STDIN> line 1.
Use of uninitialized value in hash element at /home/daniel/scripts/select_db.pl line 34, <STDIN> line 1.


Habe die warnings wie folgt eingebaut (hoffe dass war so richtig):
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 23 # Funktion zum Ueberpruefen, ob die gewuenschte DB auch konfiguriert ist
24 #
25 sub check {
26 $input=shift;
27 if($input eq '') {
28 print "Es wurde keine DB zum Connecten angegeben!\n";
29 exit 1;
30 } else {
31 my ($match) = $input =~ /\.(.+?)\./ if defined $input;
32 warn $input; warn $match;
33 $host="www.$match.de";
34 if ($hash{$match}) {
35 connect_to_db($host,$hash{$match}[0], $hash{$match}[1], $hash{$match}[0]);
36 }
37 }
38 }
D'OH
Daniel

View full thread Fehlermeldungen abfangen/unterdrücken: Use of uninitialized value in concatenat