Skip Menu |

This queue is for tickets about the CPAN-Changes CPAN distribution.

Report information
The Basics
Id: 90605
Status: resolved
Priority: 0/
Queue: CPAN-Changes

People
Owner: Nobody in particular
Requestors: KENTNL [...] cpan.org
Cc:
AdminCc:

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



Subject: Accidental sharing of data between instances
Due to add_release($params)  keeping a reference to $params, calling add_release($params) on 2 different objects with the same $params hash means later modificatons are shared.

In this example, you'll see that after adding changes to a, those same changes are added to b accidentally, due to sharing the same initial params hash.
Subject: x.pl
#!/usr/bin/env perl use strict; use warnings; use utf8; use CPAN::Changes; my $a = CPAN::Changes->new(); my $b = CPAN::Changes->new(); my $params = { version => '1.0'}; $a->add_release($params); $b->add_release($params); my ( @changes ) = ( "hello" ); $a->release('1.0')->add_changes(@changes); print $b->serialize;
Should be fixed in version 0.26; on its way to CPAN now.