On 11/05/2011 12:17 AM, Ken Peng wrote:
δΊ 2011-11-5 11:16, Anneli Cuss ει:
$! is not guaranteed to be cleared if there was no error. This means you
probably don't have a "Bad file descriptor" error, it's just the last
value
of $! (or 'errno').
That's confused.
Since there is not such an error, I was thinking $! or $@ shouldn't
include an error value.
it isn't confusing. when a system call error occurs, you get an undef
return value which says that. then you check $! to see what was the
error. clearing $! on all good calls is a waste of cpu since most calls
succeed vs the number that fail. the same is true for $@ when an eval
fails. you check the return value of the eval and if needed, then check
the value of $@ for what the error was.
uri
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/