From: Krishna Dole Date: 2003-03-26T05:50:47+09:00 Subject: Recursive methods allowed in Ruby? Does Ruby allow recursive methods? For example, in Java you can have a method call itself, and an example such as the one below will work. When I try to run the following Ruby example, I get a "stack too deep" error. (Or did I just make a stupid mistake?) Thanks, Krishna -------------------- def list_dirs( inDir ) Dir.foreach( inDir ) {|x| print( x ) if File.ftype( x ) == "directory" list_dirs( x ) end } end ARGV.each{ |dirName| list_dirs(dirName) }