Perl 6 pretty much solves the "errno" problem by using "interesting values of undef" to convey the reason the undef is undefined,
if you happen to call something like
readline in a scalar context. However, most such generators will be called using
for rather than
while, which will naturally distinguish end of list from exceptions that should be thrown, since the default action in Perl 6 is to throw an exception when it is determined that no one is checking for it directly, and generators used in list context don't generally want to poke exceptions into the list. Other interesting changes in Perl 6 include the fact that
$! is lexically scoped, not a global alias to errno. Error values are propagated to an outer dynamic scope's
$! when the decision is made whether to throw an exception or return an unthrown exception. It is hoped that this will prevent all the problems of trying to shadow C's idea of errno directly, since that's arguably one of the areas where the design of Unix was rather botched in the name of simplicity. Also, by and large,
$! is treated as merely informative and useful for interpolation, but the actual underlying mechanisms do not rely on it directly, since the actual information is in whatever exception is propagating, either by explicitly being thrown, or by being returned in an interesting undef.
$! is viewed as merely a handy reference to whatever the "current" error is.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.