From: "Marshall T. Vandegrift" Date: 2006-08-27T13:16:12+09:00 Subject: Re: Casting string to IO? Adam Block writes: > The problem is that the YAML structure is loaded as strings, so if I > specify STDOUT I get a log file named "STDOUT". Is there an elegant way > around this problem? I see two less-elegant ways: [snip] > I know casting is bad. Any suggestions appreciated. Thanks! Module#const_get might help you out: require 'logger' output = "STDOUT" output = Kernel.const_get(output) rescue output log = Logger.new(output) log.instance_variable_get("@logdev").dev == STDOUT # => true - Marshall