I want to turn off backslashing of quotes and such from the


#1

I do something like:
result=cat mess.html
p result

and all my quotes in my html file are suddenly backslashed. Is there
any way
to turn that off?

xc


#2

Hi,

At Mon, 11 Jun 2007 11:47:01 +0900,
removed_email_address@domain.invalid wrote in [ruby-talk:255079]:

result=cat mess.html
puts result


#3

On Mon, Jun 11, 2007 at 01:51:16PM +0900, Nobuyoshi N. wrote:

Hi,

At Mon, 11 Jun 2007 11:47:01 +0900,
removed_email_address@domain.invalid wrote in [ruby-talk:255079]:

result=cat mess.html
puts result

Or

print result

if you don’t want an extra newline appended.


#4

Anthony M. wrote:

On Mon, Jun 11, 2007 at 01:51:16PM +0900, Nobuyoshi N. wrote:

Hi,

At Mon, 11 Jun 2007 11:47:01 +0900,
removed_email_address@domain.invalid wrote in [ruby-talk:255079]:

result=cat mess.html

Yeah, looks like I only get the backslashes inserted when I use “p”
instead of puts and print. Thanks.


#5

On 6/11/07, Xeno C. removed_email_address@domain.invalid wrote:

Anthony M. wrote:

On Mon, Jun 11, 2007 at 01:51:16PM +0900, Nobuyoshi N. wrote:

Hi,

At Mon, 11 Jun 2007 11:47:01 +0900,
removed_email_address@domain.invalid wrote in [ruby-talk:255079]:

result=cat mess.html

Yeah, looks like I only get the backslashes inserted when I use “p”
instead of puts and print. Thanks.

That’s a feature.

seltzer:~/devel/bazaar/EarGTD sandal$ irb

a = “foo
oo”
=> “foo\noo”

puts a
foo
oo

p looks for the .inspect output, wheras puts uses .to_s
useful for debugging.