Thread Bei UTF-8 file wird erste Zeile nicht gelesen (9 answers)
Opened by crojay at 2011-06-10 10:05

pq
 2011-06-10 10:48
#149550 #149550
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
2011-06-10T08:05:20 crojay

Code: (dl )
1
2
3
4
5
6
7
8
			if (!exists $propertyHashRef{$key}){
print "key $key exists in file $jobFile with value ". $propertyHashRef->{$key} ."\n";
return $propertyHashRef->{$key};
}
else{
print "key: $key does not exist in file $jobFile\n";

}


kannst du den teil des codes mal erklären?
erstens verwendest du $propertyHashRef{$key} und $propertyHashRef->{$key}. das sind zwei verschiedene dinge, das weisst du schon, oder?
Wiki:use strict <-- lesen!

zweitens:
if ! exists führt zu einem print "key $key exists"

wundert mich eigentlich nicht, dass der code nicht so funktioniert wie erwartet.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread Bei UTF-8 file wird erste Zeile nicht gelesen