From: Leslie Viljoen Date: 2008-05-30T00:36:27+09:00 Subject: Re: Surprising Extend > > Can you show some real code and real error messages? Normally there > should not be an issue with your first approach. Ah, I was making DOS files on Linux. That thwarted my modulating. But I can still only extend String instances (s.extend) - I want to extend the String class. Here's my attempt: ----In StringExt.rb: module StringExt def to_hex unpack("C*").map{|b| b.to_s(16)}.join(" ") end end ----In use.rb: require 'StringExt' String.extend StringExt s = "anystringwilldo" puts s.to_hex ---- I get "undefined method to_hex" for my string. Thanks! Les