Thread Log::Handler: binmode, utf8 (17 answers)
Opened by bloonix at 2007-06-15 14:51

bloonix
 2007-06-16 00:23
#77556 #77556
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
hier ein simples Beispiel:

Code: (dl )
1
2
3
4
open my $fh, '>', 'file.log' or die $!;
print $fh "hello world\n" or die $!;
system('rm -f file.log && touch file.log');
print $fh "hello world\n" or die $!;


Das 2. print funktioniert natürlich nicht, da es nicht mehr die gleiche
Datei ist. Im Log::Handler gibt es die Option reopen. Mit dieser Option
prüfe ich vor jeder Schreiboperation die Inode und wenn sie sich geändert
hat, dann öffne ich die Datei neu. Auf Windows geht das leider nicht.

Wie kann ich sicherstellen, das das Filehandle zur Datei "passt"?\n\n

<!--EDIT|opi|1181939237-->
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 Log::Handler: binmode, utf8