From d134a2a6e93bbb26664b027a10d98ac996a63cfc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 18 Mar 2012 14:34:21 -0400 Subject: [PATCH] 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 --- IkiWiki/Plugin/attachment.pm | 2 +- IkiWiki/Plugin/conditional.pm | 1 - IkiWiki/Plugin/po.pm | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) 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; -- 2.26.2