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
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
Hi,
At Mon, 11 Jun 2007 11:47:01 +0900,
[email protected] wrote in [ruby-talk:255079]:
result=
cat mess.html
puts result
On Mon, Jun 11, 2007 at 01:51:16PM +0900, Nobuyoshi N. wrote:
Hi,
At Mon, 11 Jun 2007 11:47:01 +0900,
[email protected] wrote in [ruby-talk:255079]:result=
cat mess.html
puts result
Or
print result
if you don’t want an extra newline appended.
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,
[email protected] 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.
On 6/11/07, Xeno C. [email protected] 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,
[email protected] 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.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs