http://qs321.pair.com?node_id=11125465


in reply to Here documents in blocks

Something like this ?

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11125451 use warnings; sub indent { my $text = shift; $text =~ s/^\s//gm until $text =~ /^\S/m; return $text; } if (1) { print indent(<<""); Here is some test text with plenty of space and even an indented line at the start }

Outputs:

Here is some test text with plenty of space and even an indented line at the start