From: "David A. Black" Date: 2004-03-13T23:53:33+09:00 Subject: Re: long string arguments Hi -- On Sat, 13 Mar 2004, Thomas Fini Hansen wrote: > On Sat, Mar 13, 2004 at 09:21:27PM +0900, Elias Athanasopoulos wrote: > > Hello! > > > > I would like to redirect large chunks of text to a specific > > resource (file, stderr, etc). I thought that the code below > > would do my job: > > > > def |>(s) > > myputs %Q|#{s} > > end > > > > def <| > > | > > end > > Well, that doesn't work for a number of reasons. For starters it > should basically quote "\nend\n...". And I don't think <| and |> are > valid names... a = Object.new class << a define_method("|>") {|s| puts s } end a.send("|>", "a string") # a string :-) David -- David A. Black dblack@wobblini.net