Thread Tiefe Hash Strukturen aus Config bilden: Und warum while(<FH>) gefährlich ist (62 answers)
Opened by bloonix at 2006-05-09 17:07

pq
 2006-05-10 13:35
#65818 #65818
User since
2003-08-04
12209 Artikel
Admin1
[Homepage]
user image
[quote=opi,10.05.2006, 10:11]nach der for-schleife ist $_ leer[/quote]
eben, genau das ist das problem.
Code: (dl )
1
2
3
4
5
6
7
8
perl -we'$_="test";print while <>;print "\$_:$_\n"'
a
a
b
b
<CTRL-D>
Use of uninitialized value in concatenation (.) or string at -e line 1, <> line 2.
$_:

es sollte aber "test" drinstehen.
das ist ein bug, der schon ziemlich lange existiert, und ich hatte ihn schon
längst verdrängt, bis betterworld darauf aufmerksam machte.\n\n

<!--EDIT|pq|1147254023-->
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 Tiefe Hash Strukturen aus Config bilden: Und warum while(<FH>) gefährlich ist