Another fun feature of ruby is the __END__ keyword. If that keyword appears alone on a line, ruby will stop parsing the file at that line. In the same file you can use the magic DATA variable to read the rest of the file.
Eg:
#!/usr/bin/env ruby
puts DATA.read
__END__
Hello
This program will output Hello\n when executed.
This allows to easily create self-unpacking scripts for example, or to join data with code.
Another fun feature of ruby is the
__END__
keyword. If that keyword appears alone on a line, ruby will stop parsing the file at that line. In the same file you can use the magicDATA
variable to read the rest of the file. Eg:This program will output
Hello\n
when executed.This allows to easily create self-unpacking scripts for example, or to join data with code.
This feature is present in Perl too.
Perl’s documentation of its
__END__
and__DATA__
special literals: https://perldoc.perl.org/perldata.html#Special-LiteralsVery similar article that seems to be easier to understand and read than this one.
that’s your opinion.. What you say is very subjective..