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
In reply to Re: Here documents in blocks
by tybalt89
in thread Here documents in blocks
by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |