于 2011-11-5 21:03, Shawn H Corey 写道:
You're assuming that perl clears $! at the start of your script. Never
assume a variable has a valid value unless you set it yourself. In other
words, always initialize your variables.

It did clear it, see this:

$  perl -le 'print $!;open HD,"/etc/passwd" or die;<HD>;print $!'

Bad file descriptor

I don't know where the $! get setted.

Ken.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to