<div dir="ltr"><div>Peter,<br><br></div>I don't use Perl, but it seems to me that you are assigning $doc_text to $tmp and thus throwing away the new SWBuf you created. From then on, $tmp and $doc_text will refer to the same thing. The string they contain will never be different.<br><br><br><div class="gmail_extra"><div><div class="gmail_signature">God bless.<br><br><br>Mark Morgan<br><br></div></div><div class="gmail_quote">On Fri, Sep 4, 2015 at 6:12 AM, Peter von Kaehne <span dir="ltr"><<a href="mailto:refdoc@gmx.net" target="_blank">refdoc@gmx.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am trying to take a string, pack it into a SWBuf, take a copy of it<br>
into another SWBuf, run the copy through a stripfilter and then compare<br>
the string content of the outcome with the initial string:<br>
<br>
<br>
my $tmp = new Sword::SWBuf();<br>
$tmp=$doc_text; # where $doc_text is a SWBuf, obtained earlier.<br>
$manager->filterText($filter, $tmp);<br>
<br>
if ($tmp->c_str() ne $doc_text->c_str()) {<br>
print "GlobalOptionFilter=".%diacritics{$filter}."\n";<br>
}<br>
else { print "NotPresent=".%diacritics{$filter}."\n";<br>
}<br>
<br>
For reasons which are beyond me, it always runs down the "else" path.<br>
<br>
Despite the string in $doc_text having plenty of the stuff which I want<br>
to filter.<br>
<br>
Despite if I strew liberally print statements the two strings clearly<br>
being different, i.e. "unfiltered" vs "filtered"<br>
<br>
Despite if I compare by hand two strings the "ne" operator doing its<br>
job just fine. "a" ne "b" or indeed "unfiltered" ne "filtered"<br>
<br>
My forehead is bloodied by the frequency I have hit it against the<br>
wall.<br>
<br>
Suggestions?<br>
<br>
Thanks<br>
<br>
Peter<br>
<br>
_______________________________________________<br>
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a><br>
<a href="http://www.crosswire.org/mailman/listinfo/sword-devel" rel="noreferrer" target="_blank">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page<br>
</blockquote></div><br></div></div>