【发布时间】:2011-10-01 04:41:50
【问题描述】:
我正在寻找执行以下操作的正确语法(在 Perl、Shell 或 Ruby 中):
# variable to access the data lines appended as a file
END_OF_SCRIPT_MARKER
raw data starts here
and it continues.
【问题讨论】:
我正在寻找执行以下操作的正确语法(在 Perl、Shell 或 Ruby 中):
# variable to access the data lines appended as a file
END_OF_SCRIPT_MARKER
raw data starts here
and it continues.
【问题讨论】:
Perl 使用 __DATA__:
#!/usr/bin/perl
use strict;
use warnings;
while(<DATA>)
{
print;
}
__DATA__
Text to print
goes here
【讨论】:
__DATA__的等价物是__END__
__END__ 是 __DATA__ 的同义词,因此请使用其中一个。可能的相关兴趣:Inline::Files.