How to read the end of a script file as a data file (Perl or any other language)
I am looking for the correct syntax of开发者_运维问答 doing the following (in Perl, Shell or Ruby):
# variable to access the data lines appended as a file
END_OF_SCRIPT_MARKER
raw data starts here
and it continues.
Perl does this with __DATA__
:
#!/usr/bin/perl
use strict;
use warnings;
while(<DATA>)
{
print;
}
__DATA__
Text to print
goes here
精彩评论