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

Re: [MacPerl] CGI.PM (Was Recommendations on how to port a MacPerl) (fwd)



According to Aaron Munter:
> 
> On Tue, 28 Oct 1997 13:49:50 -0600 (CST) mark@cheers.jsc.nasa.gov (Mark
> Manning/Muniz Eng.) wrote:
> 
> >Anyway, I was looking through the latest release of
> >CGI.pm.  (At least I think it is the latest release - I
> >could be wrong.)  And I noticed the following:
> >	.
> >	elseif( $OSNAME=~/Mac/i){
> >	.
> 
> Perl gurus, correct me if I'm wrong, but I'm pretty sure this is correct
> syntax.  Comparison operators are ==  and != for numbers and eq and ne
> for text.  *BUT* regular expression-based comparisons use the operators
> with ~, so checking for equality uses =~ and inequality is !~.
> 
> There are also corresponding greater-than, et al permutations for the
> numbers and test portions.

What I meant was that Brian (I believe that is who it was)
pointed out to me that there are instances where "mac"
appears in $OSNAME even though you are not running under
the Mac's OS.  Specifically, MachTen contains the letters
"mac" within it.  Paul also wrote that the "eq" operator is
faster than the "=~" and should be used instead of the "=~"
when dealing with OS questions.  (Chris also showed via a
program that the "eq" is faster than the "=~".)  Thus, the
above should be:

	.
	.
	.
	elseif( $OSNAME eq "MacOS" ){
	.
	.
	.

instead of what is being used right now.  At least, that is
what I'm asking about.  I'm not asking about the syntax -
that's correct (although using the "i" option negates
having to have an uppercase "M" - but I do that also when
I'm typing so I'm not any better.  :-) ).  Nor am I asking
is this command correct or good in the context of right or
wrong.  I am asking is this correct or good as in "is this
appropriate"?  Or, in other words, is this the best way to
do the command based upon past discussions on the list and
should the author be notified so it can be changed so
potential problems are avoided?

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