in reply to Module for Perl's "here-is" text formatting
You may also want to look at loading the template from a file or __DATA__, so you're not forced to allow the extra line break that <<TAG makes mandatory.use strict; use warnings; my %vars = ( var1 => 'MyValue', ); my $here_is = <<SOME_TEXT; I want to print something with a value %var1% and some other text load etc etc SOME_TEXT $here_is =~ s/%(\w+?)%/$vars{$1}/g; print $here_is;
|
|---|