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

Re: [MacPerl] Bug report on 5.14b1 (fwd)



According to Paul J. Schinder:
> Mostly because I don't give a damn about IBM.  I did the if($^O eq "MacOS")
Oh.  Ok.  :-)

> They mean two completely different things.  eq means "compare the values of
> string x and string y and say true if they're the same".  =~ means "apply
> the string operation on the right to the string on the left".
*nod*  What I meant was -

	Why

		if( $^O eq "MacOS" ).....

	instead of something like

		if( $^O =~ /mac/i ).....

Just wondering.  I know the "eq" is more specific
but...um....how to ask this (scratches head for a few
moments)....  OK.  Let me try this again.

	if( x eq y ) means "if x is equal to y do z".
	if( x =~ /y/i ) means "if x contains y do z".

Which is different from what you said (probably because I
didn't put the "/"'s around y last time).  So what I meant
was: Is the "eq" faster than the "=~" type of statement?
Or is this just how you wrote it?

I used to write assembly language system programs for the
Univac series of computers a while back (as well as some
assembly language for the Apple and Mac) and I'm just
interested for purely esoteric reasons.  In assembly
language certain statements are faster than others and so
I'm asking simply because I'm interested in the speed
aspects of this.  Not because I'm questioning your
programming practices or anything like that.  I use a lot
of "if( x =~ /y/i )" statements in my programs simply
because it is (for me) faster to code something that way
but if MacPerl runs faster using the "eq" operator I will
probably switch some of my programs over to using that
instead.

So that's why I'm asking.  :-)

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