On Jun 25, Beau E. Cox said:

>my $string = 'I love c++';
>my $compare = 'some compare string';
>if ($compare =~ /$string/) {
>    print "$compare contains $string\n";
>} else {
>    print "$compare does not contain $string\n";
>}

Why don't you want to use

  if (index($compare, $string) > -1) { ... }

There's no need to use the regex engine if you're absolutely NOT using
patterns.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to