# Results are different by running script via irb and ruby

**URL:** <https://www.ruby-forum.com/t/results-are-different-by-running-script-via-irb-and-ruby/184071>\
**Category:** Ruby\
**Created:** [February 24, 2010, 4:18pm UTC](https://www.ruby-forum.com/t/results-are-different-by-running-script-via-irb-and-ruby/184071 "2010-02-24T16:18:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [February 24, 2010, 4:18pm UTC](https://www.ruby-forum.com/t/results-are-different-by-running-script-via-irb-and-ruby/184071/1 "2010-02-24T16:18:05Z")

</div>

Hey,

I am new to ruby. I have the following simple ruby script  
def make\_show\_name(show)  
return Proc.new {|host| show + " with " + host}  
end  
show = make\_show\_name(“Practical Cannibalism”)  
show.call(“H. Annabellector”)

when run this using irb, it prints out: Practical Cannibalism with H.  
Annabellector  
but when I saved this as test.rb and type ruby test.rb, it prints out  
nothing.

What is the problem here?

Thanks!

---

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [February 24, 2010, 4:49pm UTC](https://www.ruby-forum.com/t/results-are-different-by-running-script-via-irb-and-ruby/184071/2 "2010-02-24T16:49:11Z")

</div>

Hello,

> nothing.
> 
> What is the problem here?

irb automaticaly prints out the value of the last expression, but your  
script does not.

Try

puts show.call(“H. Annabellector”)

and it should be fine.

Cheers,
