This queue is for tickets about the Astro-FITS-Header CPAN distribution.

Report information
The Basics
Id:
127228
Status:
new
Priority:
Low/Low

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

BugTracker
Severity:
Normal
Broken in:
(no value)
Fixed in:
(no value)



Subject: Assigning to tied hash doesn't clear subheaders
When using the tied hash interface, assigning to the hash doesn't clear the subheaders. (If the assignment removed everything then it may initially appear that the tied hash is empty, but it looks like that's because FIRSTKEY fails to check for subheaders -- the old subheaders reappear as soon as there is a non-sub header.) use Astro::FITS::Header; use Data::Dumper; my $h1 = new Astro::FITS::Header(Cards => [ 'KEY1 = 1 / Example header ', 'KEY2 = 2 / Example header ', ]); my $h2 = new Astro::FITS::Header(Cards => [ 'KEY1 = 1 / Example header ', 'KEY2 = 3 / Example header ', ]); my ($hdr, @diff) = $h1->merge_primary($h2); $hdr->subhdrs(@diff); $hdr->tiereturnsref(1); my %hash; tie %hash, ref($hdr), $hdr; print Dumper(\%hash); #One top level header and one subheader as expected: #$VAR1 = { # 'KEY1' => '1', # 'SUBHEADERS' => [ # { # 'KEY2' => '2' # }, # { # 'KEY2' => '3' # } # ] # }; %hash = (); print Dumper(\%hash); #Hash initially appears to be empty: #$VAR1 = {}; $hash{'KEY3'} = 0; print Dumper(\%hash); #Old subheaders reappear: #$VAR1 = { # 'KEY3' => 0, # 'SUBHEADERS' => [ # { # 'KEY2' => '2' # }, # { # 'KEY2' => '3' # } # ] # };


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

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