Thanks go to both you and David (who presented an identical solution shortl
after this). That is so effing cool! Refresh my memory again - why are
they making Perl 6?
Regards,
Dan
···
-----Original Message-----
From: ts [mailto:decoux@moulon.inra.fr]
Sent: Friday, July 26, 2002 9:20 AM
To: ruby-talk@ruby-lang.org
Cc: ruby-talk@ruby-lang.org
Subject: Re: dynamic object creation
m = “TestClass”
require “#{m}”
t = eval “#{m}.new”eval is evil
pigeon% cat TestClass.rb
class TestClass
end
pigeon%pigeon% cat b.rb
#!/usr/bin/ruby
m = “TestClass”
require m
p Object.const_get(m).new
pigeon%pigeon% b.rb
#TestClass:0x401af914
pigeon%Guy Decoux