Thread Herausfinden ob Ausgabe umgeleitet wird (12 answers)
Opened by irata at 2009-05-06 17:07

pq
 2009-05-06 17:16
#121300 #121300
User since
2003-08-04
12209 Artikel
Admin1
[Homepage]
user image
du kannst abfragen, ob das terminal interaktiv ist:
Code (perl): (dl )
1
2
3
if (-t STDOUT) {
    ...
}


aber ich weiss nicht, ob das portabel ist, evtl. gibts auch ein cpan-modul.

edit: ja, gibt es: CPAN:IO::Interactive
Last edited: 2009-05-06 17:18:55 +0200 (CEST)
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 Herausfinden ob Ausgabe umgeleitet wird