Not 100% sure if this is an exact match, but I think it at least gets near enough in a general sense to show where it may can be of use to break or change scoping rules.
The Ruby language comes the templating class ERB, which for example in Rails is used to generate html files. If you use it looks like this:
require 'erb'
x = 42
template = ERB.new <<-EOF
The value of x is: <%= x %>
EOF
puts template.result(binding)
The binding
hands access to local variables to the ERB method call, so it can access them and use them to fill the template. (The code between the EOFs is a string, the part between <%= %> evaluated as Ruby code by ERB and would declare it's own scope like a function)
A Rails example even better demonstrates this. In an article controller, you would find something like this:
def index
@articles = Article.all
respond_to do |format|
format.html
format.xml { render :xml => @posts }
end
end
The index.html.erb file could then use the local variable @articles
like this (in this case the creation of an ERB object and the binding are handled by the Rails framework, so you don't see it here):
<ul>
<% @articles.each do |article| %>
<li><%= article.name</li>
<% end %>
</ul>
So by use of a binding variable, Ruby allows to run one and the same template code in different contexts.
The ERB class is only one example of usage. Ruby allows in general to get the actual state of execution with variable and method bindings by use of Kernel#binding, which is very useful in any context where you want to evaluate a method in different context or want to keep a context for later use.