"Randy W. Sims" wrote:

> James Edward Gray II wrote:
>
> > Fact:  This has nothing to do with ANY variables, it is the way warn()
> > is designed.
>
> Trivia:
>
> Did you know that $! does NOT contain an error string. It contains the
> error *number*. The only reason you see a error sting is that it has an
> overloaded stringification operator that calls strerror() on the numeric
> value that it contains.
>
> # assuming the file 'foo' does not exist in current directory.
>
> perl -e 'open FOO,"foo" or print $!+0'
> => 2
>
> perl -MPOSIX -e 'open FOO,"foo";print strerror $!+0'
> => No such file or directory
>
> Randy.

Cool.  Somehow, though It seems {6 * 1 == 12 / 2}-ish.  By the time the variable
is effectively accessed, the text is there.

Greetings! E:\d_drive\perlStuff>perl
open IN, 'some_nonexistent_filename' or print $!;
^Z
No such file or directory

What is intriguing to me in this is that an overloaded operator wouuld be
attched to a variable.  this sounds like it gets into prtions of Perl that I've
never really delved into.  Is $! actually sored as a number?

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to