No, there is no built-in, but many of us write ourselves.
Also for the two kinds of ql() needs for string lists. I use deQ for q() version and deQQ for qq version of those that work with the Perls "hasta" operator:
sub dequeue($$) { my($leader, $body) = @_; $body =~ s/^\s*\Q$leader\E ?//gm; return $body; } sub deQ($) { my $text = $_[0]; return dequeue q<|Q|>, $text; } sub deQQ($) { my $text = $_[0]; return dequeue qq<|QQ|>, $text; }
This allows me to use things like this:
sub compile($) { my $CODE = shift(); my $wrap = deQQ<<"END_OF_COMPILATION"; |QQ| |QQ| use warnings qw[FATAL all]; |QQ| no warnings "utf8"; |QQ| |QQ| sub { |QQ| my \$_ = shift; |QQ| $CODE; |QQ| return \$_; |QQ| } |QQ| END_OF_COMPILATION return eval $wrap; }
or
my $sorter = new Unicode::Collate:: upper_before_lower => 1, preprocess => \&reduce_for_sorting, entry => deQ<<'END_OF_OVERRIDE' |Q| |Q| 005B 006E 002E ; [.0200.0020.0002.0391]
See how it works?
source share