Subject: | Sub::Uplevel-0.2002: bug with Exporter |
Date: | Wed, 5 Nov 2008 09:07:38 -0500 |
To: | bug-Sub-Uplevel [...] rt.cpan.org |
From: | "David Golden" <dagolden [...] cpan.org> |
Show quoted text
---------- Forwarded message ----------
From: Alex Efros <powerman@powerman.name>
Date: Wed, Nov 5, 2008 at 7:45 AM
Subject: Sub::Uplevel-0.2002: bug with Exporter
To: David A Golden <dagolden@cpan.org>
Hi!
Looks like it's impossible to uplevel Exporter::import().
Thus result in workaround in my code:
local $Exporter::ExportLevel = $level + 1;
uplevel $level, $import, ($pkg, @p);
I've attached example environment for this bug. Save files as:
./uplevel_bug.pl
./X/Importer.pm
./X/Manual.pm
./X/ExportAttrs.pm
./X/Exporter.pm
and run uplevel_bug.pl. You'll see:
func1=1
func2=2
Undefined subroutine &main::func3 called at ./uplevel_bug.pl line 14.
but if you uncomment 'local $Exporter::ExportLevel' line in X/Importer.pm
it will work correctly:
func1=1
func2=2
func3=3
--
WBR, Alex.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.