Skip Menu |
 

This queue is for tickets about the Kavorka CPAN distribution.

Report information
The Basics
Id: 121872
Status: rejected
Priority: 0/
Queue: Kavorka

People
Owner: Nobody in particular
Requestors: APriven [...] actransit.org
Cc:
AdminCc:

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



Subject: Import fails with constant arguments
Date: Wed, 24 May 2017 19:25:52 +0000
To: "bug-Kavorka [...] rt.cpan.org" <bug-Kavorka [...] rt.cpan.org>
From: Aaron Priven <APriven [...] actransit.org>
Download (untitled) / with headers
text/plain 907b
Thanks so much for Kavorka, it is so much better to be able to validate things this way. I did find something I think should have worked, although I realize locked hashes are weird. It reduces down as follows: ##### ## This works: use 5.024; my %hash = ( x => [ fun => { -as => 'func' } ], ); require Kavorka; Kavorka->import( $hash{'x'}->@* ); ## This does not: use 5.024; use Const::Fast; const my %CONST_HASH => ( x => [ fun => { -as => 'func' } ], ); require Kavorka; Kavorka->import( $CONST_HASH{'x'}->@* ); ##### The error is: Attempt to access disallowed key 'implementation' in a restricted hash at .../Kavorka.pm line 99. Perhaps not the most urgent bug ever, but... -- Aaron Priven , Service Information Administrator Alameda-Contra Costa Transit District (AC Transit) 1600 Franklin St., Oakland, CA USA 94612 / +1 510 891 4865
Download (untitled) / with headers
text/plain 498b
On 2017-05-24T21:00:37+01:00, APriven@actransit.org wrote: Show quoted text
> I did find something I think should have worked, although I realize > locked hashes are weird.
The Const::Fast documentation does touch on this. The author of that module appears to consider it to be a problem with Perl itself. While this would be easy for me to work around, I'm worried it would set a precedent and people would forever be passing references to locked hashes as function arguments and expecting everything to be okay.
Subject: Re: [rt.cpan.org #121872] Import fails with constant arguments
Date: Tue, 30 May 2017 17:51:47 +0000
To: "bug-Kavorka [...] rt.cpan.org" <bug-Kavorka [...] rt.cpan.org>
From: Aaron Priven <APriven [...] actransit.org>
Download (untitled) / with headers
text/plain 922b
Well I appreciate your looking into the matter. Thank you. -- Aaron Priven , Service Information Administrator Alameda-Contra Costa Transit District (AC Transit) 1600 Franklin St., Oakland, CA USA 94612 / +1 510 891 4865 On 5/28/17, 12:59 PM, "Toby Inkster via RT" <bug-Kavorka@rt.cpan.org> wrote: <URL: https://rt.cpan.org/Ticket/Display.html?id=121872 > On 2017-05-24T21:00:37+01:00, APriven@actransit.org wrote: Show quoted text
> I did find something I think should have worked, although I realize > locked hashes are weird.
The Const::Fast documentation does touch on this. The author of that module appears to consider it to be a problem with Perl itself. While this would be easy for me to work around, I'm worried it would set a precedent and people would forever be passing references to locked hashes as function arguments and expecting everything to be okay.


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.