Thread Konsolen Ausgabe unterdrücken (18 answers)
Opened by LukeStriker at 2011-01-19 10:09

FIFO
 2011-01-19 12:35
#144835 #144835
User since
2005-06-01
469 Artikel
BenutzerIn

user image
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use warnings;
use strict;

# altes Handle sichern
open my $old_stderr, ">&STDERR";

# STDERR ins Nirwana weisen
open(STDERR, '>', 'NUL') or die $!;
warn 'invisible!';

# ...

# STDERR wieder zurücksetzen
open STDERR, '>&', $old_stderr;
warn 'STDERR resurrected!';


Varianten hier, etwa in der Mitte der Seite.
Du musst berücksichtigen, dass STDERR von Perl und OS-Shell nicht dasselbe bedeuten.
Gruß FIFO

edit: typo, Komentare
Last edited: 2011-01-19 16:31:43 +0100 (CET)
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? -- Brian Kernighan: "The Elements of Programming Style"

View full thread Konsolen Ausgabe unterdrücken