summaryrefslogtreecommitdiff
path: root/lib/if.pm
diff options
context:
space:
mode:
authorAutrijus Tang <unknown>2003-01-24 22:39:06 +0000
committerhv <hv@crypt.org>2003-02-10 01:43:12 +0000
commitb97616431c42ffbbb12f97bf297caee34b9f27a9 (patch)
treea93448d0cdd2e8b48849ab6874dc277a835cafeb /lib/if.pm
parentbea985324a3cd895f8e0a0c38e90ab3d09433415 (diff)
downloadperl-b97616431c42ffbbb12f97bf297caee34b9f27a9.tar.gz
fix for C< use if qw/ 1 open :utf8 / > based on:
Subject: [perl #20536] use if 1, open => ':utf8' fails From: Autrijus Tang (via RT) <perlbug-followup@perl.org> Message-Id: <rt-20536-49670.13.2464320257255@bugs6.perl.org> p4raw-id: //depot/perl@18684
Diffstat (limited to 'lib/if.pm')
-rw-r--r--lib/if.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/if.pm b/lib/if.pm
index 0795dee294..6574d978bb 100644
--- a/lib/if.pm
+++ b/lib/if.pm
@@ -1,13 +1,14 @@
package if;
-our $VERSION = '0.02';
+our $VERSION = '0.03';
sub work {
my $method = shift() ? 'import' : 'unimport';
return unless shift; # CONDITION
my $p = $_[0]; # PACKAGE
- eval "require $p" or die; # Adds .pm etc if needed
+ (my $file = "$p.pm") =~ s!::!/!g;
+ require $file or die;
my $m = $p->can($method);
goto &$m if $m;