X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/10f8a2c85841d5884ccee096145498af96f06f05..ec371adab1109b338a3de473298b41140ec5017e:/IkiWiki/Setup/Standard.pm diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm index 33b578e12..07a66f3db 100644 --- a/IkiWiki/Setup/Standard.pm +++ b/IkiWiki/Setup/Standard.pm @@ -14,11 +14,14 @@ sub import { sub gendump ($@) { my $class=shift; - "#!/usr/bin/perl", + my $thisperl = eval q{use Config; $Config{perlpath}}; + error($@) if $@; + + "#!$thisperl", "#", (map { "# $_" } @_), "use IkiWiki::Setup::Standard {", - IkiWiki::Setup::commented_dump(\&dumpline), + IkiWiki::Setup::commented_dump(\&dumpline, "\t"), "}" } @@ -30,6 +33,7 @@ sub dumpline ($$$$) { eval q{use Data::Dumper}; error($@) if $@; + no warnings 'once'; local $Data::Dumper::Terse=1; local $Data::Dumper::Indent=1; local $Data::Dumper::Pad="\t"; @@ -37,6 +41,7 @@ sub dumpline ($$$$) { local $Data::Dumper::Quotekeys=0; # only the perl version preserves utf-8 in output local $Data::Dumper::Useperl=1; + use warnings; my $dumpedvalue; if (($type eq 'boolean' || $type eq 'integer') && $value=~/^[0-9]+$/) {