Subject: | MAIN_MODULE available but not substituted |
Date: | Wed, 20 Aug 2008 16:47:45 -0400 |
To: | bug-module-starter-pbp [...] rt.cpan.org |
From: | Kevin Falcone <kevin [...] jibsheet.com> |
The PBP module allows you to get at all the various values in $self
(such
as distro/DISTRO) in the templates. However, some of these values
contain underscores. I wanted to use MAIN_MODULE in my README
template, but it isn't replaced because of the _ (although there is
a $self->{main_module} available).
The following fixes it:
Alternatively, a few lines up where the keys of $self are uppercased,
they could also have _s removed to be more compatible
-kevin
--- PBP.pm.orig 2008-08-20 16:46:49.000000000 -0400
+++ PBP.pm 2008-08-20 16:44:14.000000000 -0400
@@ -126,7 +126,7 @@
local $/;
my $text = <$fh>;
- $text =~ s{<([A-Z ]+)>}
+ $text =~ s{<([A-Z _]+)>}
{ $context_ref->{$1}
|| die "Unknown placeholder <$1> in $rel_file_path\n"
}xmseg;