# Help with \<\<-EOF

**URL:** <https://www.ruby-forum.com/t/help-with-eof/167699>\
**Category:** Ruby\
**Created:** [May 11, 2009, 6:37pm UTC](https://www.ruby-forum.com/t/help-with-eof/167699 "2009-05-11T18:37:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcblues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Post date:** [May 11, 2009, 6:37pm UTC](https://www.ruby-forum.com/t/help-with-eof/167699/1 "2009-05-11T18:37:07Z")

</div>

Hi,

I have a piece of code like:  
xmlData=\<\<-EOF  
xml code  
EOF

I need to change it into:  
xmlData="  
xml code  
"

but I don’t know why… it doesn’t work when I change it into a normal  
string.

Any idea?

---

<div class="post-metadata">

**Author:** ![tcblues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Post date:** [May 11, 2009, 7:02pm UTC](https://www.ruby-forum.com/t/help-with-eof/167699/2 "2009-05-11T19:02:55Z")

</div>

On 11 May 2009, at 17:37, Mario R. wrote:

> "
> 
> but I don’t know why… it doesn’t work when I change it into a normal  
> string.
> 
> Any idea?

Are you escaping all double quotes in the string?  
Also, why do you need to make the change?

Ellie

## Eleanor McHugh Games With Brains [http://slides.games-with-brains.net](http://slides.games-with-brains.net)

raise ArgumentError unless @reality.responds\_to? :reason

---

<div class="post-metadata">

**Author:** ![tcblues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Post date:** [May 11, 2009, 7:22pm UTC](https://www.ruby-forum.com/t/help-with-eof/167699/3 "2009-05-11T19:22:49Z")

</div>

Ok… I did it.  
I think the problem was a special character at the beginning of the  
string.  
Thanks for your time.

Mario R. wrote:

> There are no double quotes…

---

<div class="post-metadata">

**Author:** ![tcblues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Post date:** [May 11, 2009, 7:19pm UTC](https://www.ruby-forum.com/t/help-with-eof/167699/4 "2009-05-11T19:19:17Z")

</div>

There are no double quotes…

I need to do it because is a requirement from the client ☹  
(all string should be assigned by ")

Eleanor McHugh wrote:

> On 11 May 2009, at 17:37, Mario R. wrote:
> 
> > "

---

<div class="post-metadata">

**Author:** ![tcblues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Post date:** [May 11, 2009, 7:26pm UTC](https://www.ruby-forum.com/t/help-with-eof/167699/5 "2009-05-11T19:26:59Z")

</div>

On 11 May 2009, at 18:19, Mario R. wrote:

> There are no double quotes…
> 
> I need to do it because is a requirement from the client ☹  
> (all string should be assigned by ")

Well I guess there’s no accounting for clients lol

Ellie

## Eleanor McHugh Games With Brains [http://slides.games-with-brains.net](http://slides.games-with-brains.net)

raise ArgumentError unless @reality.responds\_to? :reason

---

<div class="post-metadata">

**Author:** ![tcblues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Post date:** [May 11, 2009, 8:35pm UTC](https://www.ruby-forum.com/t/help-with-eof/167699/6 "2009-05-11T20:35:43Z")

</div>

On 11.05.2009 19:26, Eleanor McHugh wrote:

> On 11 May 2009, at 18:19, Mario R. wrote:
> 
> > There are no double quotes…
> > 
> > I need to do it because is a requirement from the client ☹  
> > (all string should be assigned by ")
> 
> Well I guess there’s no accounting for clients lol

I’d be curios to hear the reason for this requirement.

Cheers

robert
