Skip Menu |

This queue is for tickets about the Params-Validate CPAN distribution.

Report information
The Basics
Id: 34410
Status: resolved
Priority: 0/
Queue: Params-Validate

People
Owner: Nobody in particular
Requestors: wjmoore [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.88
Fixed in: 0.91



Subject: Can't modify values of hashref returned by Params::Validate::validate
When receiving the results from Params::Validate::validate as a hashref the values can't be modified. This appears to be due to the hashref being created in the XS code. Reproduction attached. ./params_validate_hashref.pl Modification of a read-only value attempted at ./params_validate_hashref.pl line 19. Occurs under: Linux: Linux host 2.6.9-42.0.3.ELsmp #1 SMP Mon Sep 25 17:24:31 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux This is perl, v5.8.8 built for x86_64-linux and Solaris: SunOS host 5.8 Generic_117350-47 sun4u sparc SUNW,Netra-T12 This is perl, v5.8.8 built for sun4-solaris-64
Subject: params_validate_hashref.pl
#!/bin/env perl use strict; use warnings; use Data::Dumper; use Params::Validate qw(:types); my $thing = new( -region => 'Aus' ); print Dumper($thing); sub new { my $self = Params::Validate::validate( @_, { -region => { type => SCALAR }, } ); $self->{'-region'} = lc $self->{'-region'}; return $self; }