Thread Bad file descriptor (22 answers)
Opened by rosti at 2011-06-04 18:42

pq
 2011-06-04 18:53
#149412 #149412
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
$! ist nur zu benutzen nach einem fehlgeschlagenen aufruf von open (z.b.).
andernfalls enthaelt es den vorherigen fehler. perldoc perlvar:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
       $!      If used numerically, yields the current value of the C "errno"
variable, or in other words, if a system or library call fails,
it sets this variable. This means that the value of $! is
meaningful only immediately after a failure:

if (open my $fh, "<", $filename) {
# Here $! is meaningless.
...
} else {
# ONLY here is $! meaningful.
...
# Already here $! might be meaningless.
}
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 Bad file descriptor