Trouble. parse error

I have some problem when i want start program. What should I do to fix
this problem?
D:/2.rb:7: parse error, unexpected kEND, expecting $

r=10
R=20
h=30

def my_l = l(h, R, r)
Math.sqrt(h**2+(R-r)**2)
end # <= Here problem

def my_s = s(l, R, r)
Math::PI*3(R+r)+Math::PI(R**2+r**2)
end

def my_v = v(h, r, R)
Math::PI*h/3(R**2+r**2+R*r))
end

puts l(10, 20, 30)

puts v(30, 10, 20)

puts s(my_l, 20, 10)

···

--
Posted via http://www.ruby-forum.com/.

Vadim Pirogov wrote in post #1035959:

def my_l = l(h, R, r)
Math.sqrt(h**2+(R-r)**2)
end # <= Here problem

To define and call a method, just write:

def l(h, r1, r2)
  Math.sqrt(h**2 + (r1-r2)**2)
end

l(10, 20, 30)
=> 14.142135623730951

···

--
Posted via http://www.ruby-forum.com/\.