# What does '$' mean in a .rb file?

**URL:** <https://www.ruby-forum.com/t/what-does-mean-in-a-rb-file/125332>\
**Category:** Rails\
**Created:** [January 8, 2008, 10:38am UTC](https://www.ruby-forum.com/t/what-does-mean-in-a-rb-file/125332 "2008-01-08T10:38:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e95f7d/32.png) [@phil](https://www.ruby-forum.com/u/phil)\
**Post date:** [January 8, 2008, 10:38am UTC](https://www.ruby-forum.com/t/what-does-mean-in-a-rb-file/125332/1 "2008-01-08T10:38:24Z")

</div>

I am embarrassed to have to ask what is probably a very simple  
question, but, I’ve come across some code in a library that says this:

logger.debug("$language\_id = #{$language\_id}")

what does putting $ in front of a variable do?

---

<div class="post-metadata">

**Author:** ![phil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e95f7d/32.png) [@phil](https://www.ruby-forum.com/u/phil)\
**Post date:** [January 8, 2008, 10:59am UTC](https://www.ruby-forum.com/t/what-does-mean-in-a-rb-file/125332/2 "2008-01-08T10:59:27Z")

</div>

On 08 Jan 2008, at 10:38, phil wrote:

> I am embarrassed to have to ask what is probably a very simple  
> question, but, I’ve come across some code in a library that says this:
> 
> logger.debug(“$language\_id = #{$language\_id}”)
> 
> what does putting $ in front of a variable do?

[http://ruby.activeventure.com/usersguide/rg/globalvars.html](http://ruby.activeventure.com/usersguide/rg/globalvars.html)

Best regards

Peter De Berdt
