From: Walton Hoops Date: 2010-02-05T12:17:16+09:00 Subject: Re: Can Ruby Do This? On 2/4/2010 7:46 PM, Mr Bubb wrote: > Marnen Laibow-Koser wrote: > >> If you're so sure of that, why are you asking for help? There may be no >> better way in Perl, but Ruby is not Perl. :) >> > Is there a hidden camera, or something? It's not legit to say "I'm a > ruby newbie, is there a way to do x in ruby?" If I had said, hey perl > has one line comments, how do you do one line comments in ruby, would > you answer, well, why do you need one line comments? Jeez. > No I wouldn't, if on the other hand you came to me and asked "How do you do write a 'for' loop in Ruby?" I would indeed ask "why do you need a 'for' loop?" Why ask? Because while writing something akin to a 'for' is *possible* in Ruby, Ruby has other methods of achieving the same result which are preferred. Thus, seeing as your original question has been dealt with by others, it makes perfect sense to ask _why_ you would want to do something that just doesn't seem like the best _Ruby_ solution in most cases.