From: Joseph McDonald Date: 2001-10-20T15:25:21+09:00 Subject: [ruby-talk:22815] Re: PLease condense my code FM> do_print = true FM> ($<).each_line { |line| FM> case line FM> when /=begin/ then FM> do_print = false FM> when /=end/ then FM> do_print = true FM> when /=[-a-zA-Z0-9. ]*=/ then FM> # do nothing FM> else FM> if do_print then FM> puts line FM> end FM> end FM> } This one is a little shorter: while gets next if /=[-a-zA-Z0-9. ]*=/ do_print = false if /=begin/ do_print = true if /=end/ or do_print.nil? print if do_print and not /=end/ end I'm sure it will get shorter still... :-) regards, -joe