开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜