On 11-11-05 03:10 PM, Brian Fraser wrote:

On Sat, Nov 5, 2011 at 3:54 PM, Shawn H Corey <shawnhco...@gmail.com
<mailto:shawnhco...@gmail.com>> wrote:

    On 11-11-05 02:40 PM, Brian Fraser wrote:

            See `perldoc readline`. $! will be undefined if no error occurs.


        No.


    $! will be undefined, not `undef`


That's silly. Perl has no spec -- You can't have undefined behavior. You
can tell exactly what's going to happen if you look at the source.

Also, a correction for my previous message: In the second example, you
need an "or say $!;" after the readline to trigger $! being set. Same
with the <> version.


OK, from now on I'll say it's unpredictable. $! gets from C, specifically, errno (see /usr/include/errno.h). This is set by the low-level drivers in the OS during I/O. If no error occurs, its valve is unspecified, and hence, unpredictable.


--
Just my 0.00000002 million dollars worth,
  Shawn

Confusion is the first step of understanding.

Programming is as much about organization and communication
as it is about coding.

The secret to great software:  Fail early & often.

Eliminate software piracy:  use only FLOSS.

"Make something worthwhile."  -- Dear Hunter

--
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