This snippet contains some of my favorite ruby features

class Array
   def *(a)
       n    = Array.new
       [ self.length, a.length].max.
       times do |x|
           n[x] = ( self[x] || 0 ) * ( a[x] || 0 )
       end
       n
   end
end
#[ 2,4,4 ]  *  [ 5,5 ]




but by far my favorite one liner is:

ruby -r 'fileutils' -e  'FileUtils.rm("/usr/bin/perl")'


-rb.

-- 
Posted via http://www.ruby-forum.com/.