# Re: Beginner question

**URL:** <https://www.ruby-forum.com/t/re-beginner-question/104525>\
**Category:** Ruby\
**Created:** [May 19, 2007, 12:04am UTC](https://www.ruby-forum.com/t/re-beginner-question/104525 "2007-05-19T00:04:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 19, 2007, 12:04am UTC](https://www.ruby-forum.com/t/re-beginner-question/104525/1 "2007-05-19T00:04:31Z")

</div>

Thank you everyone for all the replies. I think I understand that now.

Coming to Ruby from Perl, bare variables have been a point of confusion  
for me. Heck, I started out just messing with existing scripts, and  
until I started looking at real documentation I had just assumed that  
all variables were shown as variables by the #{} notation.

This was a big help. As I said, Google was hard with this one as I had  
no context and my search terms were too vague.

Thanks!  
Jim

----- Original Message ----  
From: Avida N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: ruby-talk ML [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Friday, May 18, 2007 10:25:24 AM  
Subject: Re: Beginner question

hello Guys,

let me give another example. let say you want to create a greeting base  
on a  
person name. You will write:

def greetings(name)  
“Good Morning #{name.capitalize}”  
end

puts greetings(‘loi’)  
“Good Morning Loi”

as you can see the #{} allows you to create complex expressions. In this  
case you were able to capitilize the name Loi even though you entered it  
in  
lower case letter. So when the interpreter does the interpolation sees  
the  
method capitalize and capitalize the name for you.

I hope this example will help you

Carlos Henriquez

On 5/18/07, Sebastian H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> This will return (of course) print out “The number is x” because ruby has
> 
> –  
> Ist so, weil ist so  
> Bleibt so, weil war so

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_Looking  
for a deal? Find great prices on flights and hotels with Yahoo!  
FareChase.  
[http://farechase.yahoo.com/](http://farechase.yahoo.com/)
