From: Graham Knop Date: Mon, 18 Nov 2013 19:41:03 +0000 (-0500) Subject: use more reasonable class name and protect against outer pragmas X-Git-Tag: v0.010000~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f147c6f08a0d3d16fb512f65bae989850a6afc90;p=p5sagit%2FApp-FatPacker.git use more reasonable class name and protect against outer pragmas --- diff --git a/lib/App/FatPacker.pm b/lib/App/FatPacker.pm index 0ca5c86..8b623ac 100644 --- a/lib/App/FatPacker.pm +++ b/lib/App/FatPacker.pm @@ -268,13 +268,13 @@ sub fatpack_end { return stripspace <<' END_END'; s/^ //mg for values %fatpacked; - my $class = "${\\%fatpacked}"; + my $class = 'FatPacked::'.(0+\%fatpacked); + no strict 'refs'; *{"${class}::files"} = sub { keys %{$_[0]} }; if ($] < 5.008) { - *{"${class}::INC"} = sub { - if (my $fat = $fatpacked{$_[1]}) { + if (my $fat = $_[0]{$_[1]}) { return sub { return 0 unless length $fat; $fat =~ s/^([^\n]*\n?)//;