From bb258b56b29cb01f27bdc0dfd0bced55a88574ed Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 19 Mar 2009 15:35:57 -0400 Subject: avoid crashing if Sort::Naturally is not installed --- IkiWiki/Plugin/inline.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index a89e827c1..218fd7515 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -195,7 +195,10 @@ sub preprocess_inline (@) { @list=sort { pagetitle(basename($a)) cmp pagetitle(basename($b)) } @list; } elsif (exists $params{sort} && $params{sort} eq 'title_natural') { - require Sort::Naturally; + eval q{use Sort::Naturally}; + if ($@) { + error(gettext("Sort::Naturally needed for title_natural sort")); + } @list=sort { Sort::Naturally::ncmp(pagetitle(basename($a)), pagetitle(basename($b))) } @list; } elsif (exists $params{sort} && $params{sort} eq 'mtime') { -- cgit v1.2.3