# Re: eRB \<%=

**URL:** <https://www.ruby-forum.com/t/re-erb/68650>\
**Category:** Ruby\
**Created:** [September 14, 2006, 6:32am UTC](https://www.ruby-forum.com/t/re-erb/68650 "2006-09-14T06:32:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [September 14, 2006, 6:32am UTC](https://www.ruby-forum.com/t/re-erb/68650/1 "2006-09-14T06:32:03Z")

</div>

From: Rob S. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]

> One thing I’ve often wondered is how do you output from w/i a “non  
> output” block…ie in java scriptlets these are equivalent:
> 
> \<% out.println(“hi”) %\>  
> \<%= “hi” %\>
> 
> With ERB I’ve had some (admittedly rare) cases where this would be  
> useful. Is it possible?

As others have noted, you can concatenate to the \_erbout string  
variable.  
You can also name this variable whatever you like (4th param to the ERB  
initializer).  
You can also patch ERB so that print/puts/p all do what you might  
expect:

[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/152909](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/152909)
