Skip Menu |

This queue is for tickets about the Const-Fast CPAN distribution.

Report information
The Basics
Id: 61726
Status: resolved
Priority: 0/
Queue: Const-Fast

People
Owner: LEONT [...] cpan.org
Requestors: ray [...] 1729.org.uk
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.004
  • 0.005
Fixed in: (no value)



Subject: Hash loses regexp values
Perl version: 5.8.8 The following code does not work as expected: use Const::Fast; const my %rx => ( foo => qr/foo/ ); See attached tryme.pl for some simple tests demonstrating the problem.
Subject: tryme.pl
#!/usr/bin/env perl use strict; use warnings FATAL => 'all'; use Const::Fast; use Test::More; use Data::Dumper; { const my $rx => { foo => qr/foo/ }; isa_ok $rx, 'HASH'; isa_ok $rx->{foo}, 'Regexp'; # passes } { my %rx = ( foo => qr/foo/ ); isa_ok \%rx, 'HASH'; isa_ok $rx{foo}, 'Regexp'; # passes } { const my %rx => ( foo => qr/foo/ ); isa_ok \%rx, 'HASH'; isa_ok $rx{foo}, 'Regexp' or diag( Dumper( \%rx ) ); # fails } done_testing();
Hi ray, Thanks for the bug report. I've just uploaded version 0.006, which fixes this issue. Regards, Leon