# Carriage Return added during return of large string from cla

**URL:** <https://www.ruby-forum.com/t/carriage-return-added-during-return-of-large-string-from-cla/53705>\
**Category:** Ruby\
**Created:** [February 13, 2006, 9:39pm UTC](https://www.ruby-forum.com/t/carriage-return-added-during-return-of-large-string-from-cla/53705 "2006-02-13T21:39:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xeno\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Post date:** [February 13, 2006, 9:39pm UTC](https://www.ruby-forum.com/t/carriage-return-added-during-return-of-large-string-from-cla/53705/1 "2006-02-13T21:39:54Z")

</div>

Say, this is a doosey: I’m constructing a string of markup for a CGI  
script,  
and I’m deciding to convert to print as I go rather than all at once, so  
I  
code, then start debugging, and to debug I dump markup. I then find  
that  
markup that looks good and clean just before I return from my class  
function  
(called by another class function if that’s important) ends up having  
sections  
polluted with carriage returns (not all of it, just those newlines which  
precede each line of one of the three concatenated strings from the  
three  
files which I uploaded from my primary files (javascript code). So I  
get  
all these files loaded, strings concatenated, and right before I return  
them  
from my old function I dump them and they look fine. Right after they  
get  
returned from the old function to the new one, this one section has CRs.  
What  
gives? Were they there all along and suddenly only appear from some  
magic?  
How could it otherwise be that the function, in it’s wild and unexpected  
massage of my markup, is guessing well enough to precede only those  
lines  
which correspond to one of my files?

The code is non-trivial, and I cannot afford to pull it apart right now.  
I’ll  
try to make the time tonight. Presumably this is something you gurus  
know all  
about.

xc
