in reply to Loops and comparisons

You say:

This comparison does not seem to be working:

if ($third_char ne 'c' || $third_char ne 'd'){ $part=substr($stri,0,2);
What is the mistake here?

I guess it depends upon what you mean by "not working"; I assume you are aware that it is unlikely that any single character would fail to satisfy your test?

:)

Draw a Venn diagram :) :)