+ # Backwards compatability with old calling convention.
+ if (@params == 1) {
+ unshift @params, 'location';
+ }
+
+ my $ret=eval pagespec_translate($spec);
+ return IkiWiki::FailReason->new('syntax error') if $@;
+ return $ret;
+} #}}}
+
+package IkiWiki::FailReason;
+
+use overload ( #{{{
+ '""' => sub { ${$_[0]} },
+ '0+' => sub { 0 },
+ '!' => sub { bless $_[0], 'IkiWiki::SuccessReason'},
+ fallback => 1,
+); #}}}
+
+sub new { #{{{
+ return bless \$_[1], $_[0];