]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
mention makemaker variables
[ikiwiki.git] / IkiWiki.pm
index 3802559a53d6c60569464a17b95109f9eab807a5..98145a585efda00b7110db7762b3be7106c169c9 100644 (file)
@@ -282,14 +282,15 @@ sub htmlpage ($) { #{{{
        return targetpage($page, $config{htmlext});
 } #}}}
 
-sub srcfile ($) { #{{{
+sub srcfile ($;$) { #{{{
        my $file=shift;
+       my $nothrow=shift;
 
        return "$config{srcdir}/$file" if -e "$config{srcdir}/$file";
        foreach my $dir (@{$config{underlaydirs}}, $config{underlaydir}) {
                return "$dir/$file" if -e "$dir/$file";
        }
-       error("internal error: $file cannot be found in $config{srcdir} or underlay");
+       error("internal error: $file cannot be found in $config{srcdir} or underlay") unless $nothrow;
        return;
 } #}}}
 
@@ -1286,7 +1287,9 @@ use overload ( #{{{
 ); #}}}
 
 sub new { #{{{
-       return bless \$_[1], $_[0];
+       my $class = shift;
+       my $value = shift;
+       return bless \$value, $class;
 } #}}}
 
 package IkiWiki::SuccessReason;
@@ -1299,7 +1302,9 @@ use overload ( #{{{
 ); #}}}
 
 sub new { #{{{
-       return bless \$_[1], $_[0];
+       my $class = shift;
+       my $value = shift;
+       return bless \$value, $class;
 }; #}}}
 
 package IkiWiki::PageSpec;