我知道很多Ruby都受到Perl(例如STDIN作为全局常量)或Unix shell(例如<<ENDheredoc语法)的启发.但我不知道块注释语法的来源.语法:
=begin
This is a comment line
it explains that the next line of code displays
a welcome message
=end
Run Code Online (Sandbox Code Playgroud)
这是从哪里来的?我对Perl的了解很粗略.它是Perl吗?
Sam*_*Sam 25
是的,这是Perl
Perl使用
=begin
This is a comment line
it explains that the next line of code displays
a welcome message
=cut
Run Code Online (Sandbox Code Playgroud)
看看这里:http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(syntax)#Comments