[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [long] Re: [MacPerl] Recommendations on how to port a MacPerl (fwd)



According to Chris Nandor:
> 
> At 10.52 10/27/97, Mark Manning/Muniz Eng. wrote:
> >One correction here.  The above should be:
> >
> >        if( $OSNAME == "MacOS" )
> >
> >The one given by Satrapa would make $OSNAME equal "MacOS".
> >Also, according to the Perl book, even this is not
> >correct.  It should be:
> >
> >        if( $OSNAME eq "MacOS" )
> >
> >since it is a string variable and not a number.  However, I
> >do believe that Perl will correct the above on it's own.
> >It's just that it takes a bit more overhead (ie: time) for
> >Perl to figure it out.
> 
> No, it will not work.  In a numeric context, $OSNAME, $^O
and "MacOS" are equal to 0.  eq will work, == will not.
> 
> In comparisons, Perl does care about whether something is
a string or number, because they are evaluated
differently.  For instance, 099 lt 1, but 099 > 1.

Ah!  :-)  Ok, so neither "=" nor "==" will work.  :-)  What
can I say?  My brain's on vacation today because it's
Monday.  :-P

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch