Well, if you just want to compare two strings to see if the values are
identical, that should be
if ( $myString eq $myOtherString )

The == operator is for NUMERIC comparisons, while eq is for STRING
comparisons.

As pointed out elsewhere, if you want to see if one string is contained
within another, then the index function would be appropriate.  A regular
expression match could of course do this, but introduces other complexities,
that are better avoided if this is all you need.

-----Original Message-----
From: "Liss, Mike" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: RE: A little harder newbie question.... 
Date: Tue, 14 Jan 2003 15:45:19 -0800

Eugene,

This is just too complicated... 

Why can't it simply be:


  $myString = "what ever you want";

  $myOtherString = "Something else";

  if( $myString == $myOtherString )
  {
     &proceed();
  }
  else
  {
     &stop();
  }


Maybe I am just having a difficulty wrapping my head
around this different paradigm in programming.. 
but shouldn't a string compare be easy ??

Mike

 
**************************************************************************
The information transmitted herewith is sensitive information intended only
for use by the individual or entity to which it is addressed. If the reader
of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to