"Perl Programmers Reference Guide (англ.) (программ.) /19.12.1998/ " - читать интересную книгу автораA line-oriented form of quoting is based on the shell "here-doc" syntax. Following a << you specify a string to terminate the quoted material, and all lines following the current line down to the terminating string are the value of the item. The terminating string may be either an identifier (a word), or some quoted text. If quoted, the type of quotes you use determines the treatment of the text, just as in regular quoting. An unquoted identifier works like double quotes. There must be no space between the << and the identifier. (If you put a space it will be treated as a null identifier, which is valid, and matches the first empty line.) The terminating string must appear by itself (unquoted and with no surrounding whitespace) on the terminating line. print < EOF print <<"EOF"; # same as above The price is $Price. EOF print <<`EOC`; # execute commands echo lo there EOC print <<"foo", <<"bar"; # you can stack them I said foo. foo I said bar. bar 14/Jun/98 perl 5.005, patch 02 15 PERLDATA(1) Perl Programmers Reference Guide PERLDATA(1) myfunc(<<"THIS", 23, <<'THAT'); Here's a line or two. THIS |
|
|