From: Joey Hess Date: Sun, 18 Mar 2012 18:34:21 +0000 (-0400) Subject: avoid unnecessary uses of UNIVERSAL X-Git-Tag: 3.20120203~19 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/d134a2a6e93bbb26664b027a10d98ac996a63cfc avoid unnecessary uses of UNIVERSAL Foo->Bar->can("method") works just as well, even if Foo::Bar is not loaded. Using UNIVERSAL::can is deprecated. But, I was unable to easily eliminate conditional.pm's use of UNIVERSAL::can --- diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 5a180cd5c..133a54daf 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -148,7 +148,7 @@ sub formbuilder (@) { $f=Encode::decode_utf8($f); $f=~s/^$page\///; if (IkiWiki::isinlinableimage($f) && - UNIVERSAL::can("IkiWiki::Plugin::img", "import")) { + IkiWiki::Plugin::img->can("import")) { $add.='[[!img '.$f.' align="right" size="" alt=""]]'; } else { diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm index 026078b3c..0a3d7fb4c 100644 --- a/IkiWiki/Plugin/conditional.pm +++ b/IkiWiki/Plugin/conditional.pm @@ -4,7 +4,6 @@ package IkiWiki::Plugin::conditional; use warnings; use strict; use IkiWiki 3.00; -use UNIVERSAL; sub import { hook(type => "getsetup", id => "conditional", call => \&getsetup); diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 6410a1c66..287b5aa11 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -23,7 +23,6 @@ use File::Copy; use File::Spec; use File::Temp; use Memoize; -use UNIVERSAL; my ($master_language_code, $master_language_name); my %translations;