Use Perl here documents to print multiple lines of output
example:
PERL:
-
print <<FOO;
-
Perl offers a convenient way of printing multiple lines of output through an interesting feature known as a "Perl here document".
-
-
A multiline Perl here document works like this:
-
<ol>
-
<li>The first line of your command will include the two characters <code><<</code> followed by a "special" identifier string, followed by a semi-colon. (For my example I will use the identifier string <code>FOO</code>. More on this shortly.)</li>
-
<li>Next, just enter all of the lines of output that you want to print.</li>
-
<li>When you are ready to terminate the output, put your special identifier string on a line by itself to end the output.</li>
-
</ol>
-
FOO
遇到反斜線需要 double。