Content deleted Content added
Link to official docs (ruby-doc.org is not official) |
Make clear link is for Ruby |
||
Line 46:
==Interpreted languages==
Some interpreted languages offer a similar facility to the data segment, notably [[Perl]]<ref>[http://perldoc.perl.org/perldata.html#Special-Literals perldata: Special Literals]</ref> and [[Ruby (programming language)|Ruby]].<ref>Ruby: Embedded Data: [https://docs.ruby-lang.org/en/master/globals_rdoc.html#label-Embedded+Data]</ref> In these languages, including the line <code>__DATA__</code> (Perl) or <code>__END__</code> (Ruby, old Perl) marks the end of the code segment and the start of the data segment. Only the contents prior to this line are executed, and the contents of the source file after this line are available as a file object: <code>PACKAGE::DATA</code> in Perl (e.g., <code>main::DATA</code>) and <code>DATA</code> in Ruby. This can be considered a form of [[here document]] (a file literal).
==See also==
|