in reply to DBI mysql select truncating on special character

A couple things that come to mind (might not help, but just in case):

If the printing is being done in the context of html or xml output (e.g. for display on a web page), then obviously you would need to convert all angle brackets and ampersands to their corresponding entity references before printing them (  s/\&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g;).

(Update: rearranged the order of those substitutions -- ampersands need to be done first; of course, someone will probably recommend a module to do those replacements, which is probably a good idea.)

Have you checked the length of "$Ttorun", in addition to printing its contents? (Is it actually longer when you remove the "<" from the database record, and shorter when the record contains "<"?)

Replies are listed 'Best First'.
Re^2: DBI mysql select truncating on special character
by bwern (Initiate) on May 10, 2006 at 03:13 UTC
    Graff, You were completely on the mark - when I checked the length it led me to the answer -- my string handling was truncating selected data becuase I wasn't handling quoting properly. Thanks for pointing me in the right direction!