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

bloonix
 2006-05-14 16:05
#65847 #65847
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
[quote=Strat,14.05.2006, 13:22]genauso wie das Problem mit den globalen FILEHANDLE's[/quote]
hallo strat, das verstehe ich nicht ganz. welche probleme kann es da
geben? ich habe mal folgendes ausprobiert...

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
package TestModul;

sub do_open {
local $_;
open FH,'<','./test.txt' or die $!;
while (<FH>) {
print;
}
close FH;
}

1;


Code: (dl )
1
2
3
4
5
6
7
8
9
10
use TestModul;

open FH,'<','./test.txt' or die $!;

while (<FH>) {
TestModul->do_open;
print;
}

close FH;


ich konnte keine probleme feststellen.
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.

View full thread Tiefe Hash Strukturen aus Config bilden: Und warum while(<FH>) gefährlich ist