diff options
author | Steffen Müller <0mgwtfbbq@sneakemail.com> | 2002-08-25 02:27:59 +0200 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-08-29 11:48:39 +0000 |
commit | a3e5cfd4c30bff9d1d50fd3f8db258b33693d62c (patch) | |
tree | fa212a6548608fcc7e4ddfa2f368a15fdb642235 /lib/if.pm | |
parent | 4d76a3443f3312704ec3416fd425698e92a208cd (diff) | |
download | perl-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.pm | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 } |