From: Marko Schulz Date: 2001-04-24T01:27:18+09:00 Subject: [ruby-talk:14086] Re: RCR: getClassFromString method On Mon, Apr 23, 2001 at 08:40:04PM +0900, Harry Ohlsen wrote: > > [ Getting a class by its name in a string using eval ] > > I'm not sure why you do the check on the validity of the class name. I > assume it's because otherwise the eval would throw an exception? No. I am always a little bit more cautios when using evals since you the string passed into it could contain everything. You might not expect that you could accidently delete files, just because you asked for a class. I am probably careful at this from the time I did CGI-Programming in Perl. But the solution using Module::const_get by Minero Aoki looks much nicer anyhow. And it is more correct too. Then again I agree with matz that such a 'feature' is of doubtful usefullness. I really don't see good reasons why it should be added to the language. -- marko schulz Dieser Satz beinhalten drei Fehller.