in reply to Re: best way to print paragraphs of text
in thread best way to print paragraphs of text

You seem to think that here-doc terminators cannot contain whitespace. You're wrong. ... but the output will [still] have leading spaces ...
I vaguely recall a discussion somewhere of a multi-line string quotation mechanism (perhaps a here-doc?) in which indentation whitespace would or could be automatically removed at compile-time by invoking the right syntactic spell. I don't see anything like this in perlop. Am I imagining things? Was or is this something associated with Perl 6?
  • Comment on Re^2: best way to print paragraphs of text

Replies are listed 'Best First'.
Re^3: best way to print paragraphs of text
by JavaFan (Canon) on Aug 09, 2009 at 14:15 UTC
    That's indeed a perl6 thing. In perl5, you need to remove the white space yourself. I would guess with Devel::Declare it may be possible to do some kind of auto-leading-white-space-removal, but my knowledge of the optree is too limited to know how.
Re^3: best way to print paragraphs of text
by Anonymous Monk on Aug 09, 2009 at 06:13 UTC
    my $output = <<" OUTPUT"; Today is Monday. Bla bla bla. ... Who knows. MONDAY OUTPUT $output =~ s/^ //gm; print $output; __END__ Today is Monday. Bla bla bla. ... Who knows. MONDAY