23

I know that a lot of Ruby was inspired by Perl (e.g. STDIN as a global constant) or Unix shell (e.g. the <<END heredoc syntax). But I don't know where the block comment syntax comes from. The syntax:

=begin
This is a comment line
it explains that the next line of code displays 
a welcome message
=end

Where does this come from? My knowledge of Perl is sketchy. Is it Perl?

dan
  • 43,914
  • 47
  • 153
  • 254
  • I like the question but its probably for the ruby-core mailing list. – Swanand Jan 08 '12 at 06:36
  • 8
    To those voting to close: I don't see how this will "solicit opinion, debate, arguments, polling, or extended discussion" and not "involve facts, references, or specific expertise". It would seem to be answerable in a straightforward manner. – porges Jan 13 '12 at 03:26

1 Answers1

27

yes, this is Perl

Perl uses

=begin
This is a comment line
it explains that the next line of code displays 
a welcome message
=cut

have a look here: http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(syntax)#Comments

Sam
  • 3,453
  • 1
  • 33
  • 57
  • 1
    It's part of the [POD syntax](http://perldoc.perl.org/perlpod.html) used to extract inline documentation from Perl code, see http://stackoverflow.com/a/3828297/239657 – Beni Cherniavsky-Paskin Nov 01 '16 at 12:24