]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
avoid unnecessary uses of UNIVERSAL
authorJoey Hess <joey@kitenet.net>
Sun, 18 Mar 2012 18:34:21 +0000 (14:34 -0400)
committerJoey Hess <joey@kitenet.net>
Sun, 18 Mar 2012 18:34:21 +0000 (14:34 -0400)
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
IkiWiki/Plugin/conditional.pm
IkiWiki/Plugin/po.pm

index 5a180cd5cf3c3eaac5282ef267982327e49eba8d..133a54dafd718f15cb763503c7d9b5d80b17d577 100644 (file)
@@ -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 {
index 026078b3ccf6751c26418d329a62f715b1bb5252..0a3d7fb4cd18ef14261eb6896722c0991d8405dd 100644 (file)
@@ -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);
index 6410a1c663ceba0b615a6d3959bb27c3dd20b609..287b5aa11de37304a8d330f80894879618a166bd 100644 (file)
@@ -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;