# End\_eval

**URL:** <https://www.ruby-forum.com/t/end-eval/96123>\
**Category:** Ruby\
**Created:** [June 26, 2006, 5:10pm UTC](https://www.ruby-forum.com/t/end-eval/96123 "2006-06-26T17:10:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![greenbox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e99b99/32.png) [@greenbox](https://www.ruby-forum.com/u/greenbox)\
**Post date:** [June 26, 2006, 5:10pm UTC](https://www.ruby-forum.com/t/end-eval/96123/1 "2006-06-26T17:10:41Z")

</div>

Trying to teach myself some metaprogramming and have been sifting  
through the rails source. I often see:  
module\_eval \<\< -end\_eval  
stuff to add  
end\_eval

I understand what this does, but I’m curious what part of the language  
the -end\_eval construct is coming from.

Thanks,  
Brad

---

<div class="post-metadata">

**Author:** ![greenbox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e99b99/32.png) [@greenbox](https://www.ruby-forum.com/u/greenbox)\
**Post date:** [June 26, 2006, 5:26pm UTC](https://www.ruby-forum.com/t/end-eval/96123/2 "2006-06-26T17:26:19Z")

</div>

On 6/26/06, Brad C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Trying to teach myself some metaprogramming and have been sifting  
> through the rails source. I often see:  
> module\_eval \<\< -end\_eval  
> stuff to add  
> end\_eval
> 
> I understand what this does, but I’m curious what part of the language  
> the -end\_eval construct is coming from.

module\_eval \<\<-EOS  
string-of-stuff-to-add  
EOS

It’s what’s called a heredoc.

-austin

---

<div class="post-metadata">

**Author:** ![greenbox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e99b99/32.png) [@greenbox](https://www.ruby-forum.com/u/greenbox)\
**Post date:** [June 26, 2006, 5:30pm UTC](https://www.ruby-forum.com/t/end-eval/96123/3 "2006-06-26T17:30:12Z")

</div>

it’s the same as print \<\< -HERE  
HERE  
the - means HERE does not have to be the first part of the line and can  
be indented
