develooper Front page | perl.perl5.porters | Postings from July 2016

Re: Indented here docs?

Thread Previous | Thread Next
From:
Ed Avis
Date:
July 1, 2016 10:38
Subject:
Re: Indented here docs?
Message ID:
loom.20160701T123602-361@post.gmane.org
If this is added, there need to be checks that the indentation is consistent
through the heredoc.  So for example this would not be allowed:


    $foo = <<~END;
    hello
  there
    END

Error at line 3: leading indentation on line is less than the indentation of
the end delimiter.

At least, I would prefer that.  This restriction could be relaxed later if it
turns out to get in the way, but it would be hard to add it if it weren't
there originally, so I suggest it's safer to include the restriction in the
first version of this new feature.

-- 
Ed Avis <eda@waniasset.com>



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About