Skip Menu |
 

This queue is for tickets about the Kavorka CPAN distribution.

Report information
The Basics
Id: 97875
Status: open
Priority: 0/
Queue: Kavorka

People
Owner: Nobody in particular
Requestors: ilmari.ikonen [...] outlook.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Error with prototypes
Date: Fri, 8 Aug 2014 15:31:25 +0300
To: "bug-kavorka [...] rt.cpan.org" <bug-kavorka [...] rt.cpan.org>
From: ilmari ikonen <ilmari.ikonen [...] outlook.com>
Download (untitled) / with headers
text/plain 456b
On Kavorka-0.030 and Perl 5.20 (Linux debian 3.2.0-4-686-pae #1 SMP Debian 3.2.60-1+deb7u1 i686 GNU/Linux) I get the error Variable "$x" is not available at test.pl line 17 when executing the code: use v5.14;use warnings;use Kavorka; my $tf = sub { 1;}; sub test (&){ $_[0];} my $a = test { my $x = $tf->(); fun(){ $x+$_[0]; }}; It works if sub is used instead of fun(). I'm not sure why this particular case should fail.
Download (untitled) / with headers
text/plain 362b
Fun. I guess it's having trouble closing over $x for some reason. Bizarre though because this works fine: use v5.14; use warnings; use Kavorka; sub test (&) { $_[0] } my $a = test { my $x = 1; fun { $x+$_[0] } }; I think in that case, $x is known to be 1, so gets optimized away within the function and is never really closed over. It's strange though.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.