echo "Hello World" | ruby -e"puts STDIN.read"puts STDIN.read
Since the main topic here is golfing I advice to use ARGF or $< instead of STDIN.
Since the main topic here is golfing I advice to use ARGF or $< instead of STDIN.
gets sets $_ to the text that was read and some other methods in Kernel operate on $_ could save you a few bytes.
I was just wondering how one would test something like (using the basic example):
puts STDIN.read
?
Please give an example, I can't make this work!