puts "Hello, Ruby!";
print <<show # 与puts输出的结果相同
I am wang,
and who are you?
show
print <<'EOC'; # 同上echo I here
EOC
BEGIN { # begin语法里面的code会在程序开始执行
puts "the begin text"
}
运行结果
END{ # END语法里面的code会在程序结束前执行
puts "the begin text"
}
BEGIN { # begin语法里面的code会在程序开始执行
puts "the begin text"
}