In perl.git, the branch smoke-me/alh/indented-heredocs has been created <http://perl5.git.perl.org/perl.git/commitdiff/c2e72ff9617ff8c524ecf7490286d8f3460804e3?hp=0000000000000000000000000000000000000000>
at c2e72ff9617ff8c524ecf7490286d8f3460804e3 (commit) - Log ----------------------------------------------------------------- commit c2e72ff9617ff8c524ecf7490286d8f3460804e3 Author: Matthew Horsfall <wolfs...@gmail.com> Date: Fri Nov 11 06:35:32 2016 -0500 Document Indented Heredocs M pod/perlop.pod commit 9acf75761dee091d0831baa2da018cc55d42dceb Author: Matthew Horsfall <wolfs...@gmail.com> Date: Fri Nov 11 04:58:18 2016 -0500 Add indented heredocs. This adds a new modifier '~' to heredocs that tells the parser that it should look for /^\s*$DELIM\n/ as the closing delimiter. These syntaxes are all supported: <<~EOF; <<~'EOF'; <<~"EOF"; <<~\EOF; The '~' modifier will strip, from each line in the heredoc, the same whitespace that appears before the delimiter. Newlines will be copied as is, and lines that don't include the proper beginning whitespace will cause perl to croak. Some examples: if (1) { print <<~EOF; Hello there EOF } prints "Hello there\n"; The following: if (1) { print <<~EOF; Hello There EOF } croaks with: Indentation on line 1 of heredoc doesn't match delimiter at - line 2. M pod/perldiag.pod M t/op/exec.t M t/op/heredoc.t M toke.c ----------------------------------------------------------------------- -- Perl5 Master Repository