Difference between puts and print

Hello all

What is the difference between ‘print’ and ‘puts’ in rubese? What are the
advantages or disadvantages to using each?

Thanks
–Andrew

puts “hello”

is like

print “hello\n”

I don’t like typing “\n” at the end, so I generally use puts. But the
rare time I don’t want a terminating new line I have to go back to print.

Daniel.

···

Hello all

What is the difference between ‘print’ and ‘puts’ in rubese? What are the
advantages or disadvantages to using each?

Thanks
–Andrew

Hello all

What is the difference between ‘print’ and ‘puts’ in rubese? What are the
advantages or disadvantages to using each?

#puts appends a newline and outputs each argument to a new line
#print doesn’t append anything and seems to separate arguments by a space

The “new line”/“space” bits are probably affected by some variable, but that’s
the practical difference, anyway.

Thanks
–Andrew

Gavin

···

From: “andrew delboy” andrew@cyber.com.au