summaryrefslogtreecommitdiff
path: root/lib/if.pm
diff options
context:
space:
mode:
authorSteffen Müller <0mgwtfbbq@sneakemail.com>2002-08-25 02:27:59 +0200
committerhv <hv@crypt.org>2002-08-29 11:48:39 +0000
commita3e5cfd4c30bff9d1d50fd3f8db258b33693d62c (patch)
treefa212a6548608fcc7e4ddfa2f368a15fdb642235 /lib/if.pm
parent4d76a3443f3312704ec3416fd425698e92a208cd (diff)
downloadperl-a3e5cfd4c30bff9d1d50fd3f8db258b33693d62c.tar.gz
Re: if.pm bug.
From: "Steffen Mueller" <kjx9zthh3001@sneakemail.com> Message-ID: <20020824222210.16387.qmail@onion.perl.org> p4raw-id: //depot/perl@17799
Diffstat (limited to 'lib/if.pm')
-rw-r--r--lib/if.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/if.pm b/lib/if.pm
index 32c4fad45e..0795dee294 100644
--- a/lib/if.pm
+++ b/lib/if.pm
@@ -1,13 +1,16 @@
package if;
-our $VERSION = '0.01';
+our $VERSION = '0.02';
sub work {
my $method = shift() ? 'import' : 'unimport';
return unless shift; # CONDITION
- my $p = shift; # PACKAGE
+
+ my $p = $_[0]; # PACKAGE
eval "require $p" or die; # Adds .pm etc if needed
- $p->$method(@_) if $p->can($method);
+
+ my $m = $p->can($method);
+ goto &$m if $m;
}
sub import { shift; unshift @_, 1; goto &work }