From: Sebastian Riedel Date: Wed, 23 Nov 2005 01:35:14 +0000 (+0000) Subject: Improved PAR support X-Git-Tag: 5.7099_04~845 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=975ba10392f106efdb4ca8a0fbbe969234bbd518;hp=839ff59e541072d9d9b3bedf7b9320eccf7168b5 Improved PAR support --- diff --git a/Changes b/Changes index c38e4b1..0502811 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ This file documents the revision history for Perl extension Catalyst. 5.58 + - Improved PAR support - Replaced -short with auto-detection - Fixed prereqs, added File::Copy::Recursive diff --git a/lib/Module/Install/Catalyst.pm b/lib/Module/Install/Catalyst.pm index f814b79..22efcda 100644 --- a/lib/Module/Install/Catalyst.pm +++ b/lib/Module/Install/Catalyst.pm @@ -169,15 +169,16 @@ sub _catalyst_par { my $version = $Catalyst::VERSION; my $class = $self->name; + my $script_file = IO::File->new("< $script"); + my $script_content = do { local $/; <$script_file> }; + my $classes = ''; $classes .= " require $_;\n" for @Catalyst::Module::Install::CLASSES; - my $tmp_file = IO::File->new(" > $par_pl "); + my $tmp_file = IO::File->new("> $par_pl "); print $tmp_file <<"EOF"; require lib; if (\$0 !~ /par.pl\.\\w+\$/) { - import lib '../lib'; - require FindBin; - require "\$FindBin::Bin/script/$script"; +$script_content } else { import lib 'lib';