#!/perl/bin/perl use strict; use warnings; use DBM::Deep; use Data::Dumper; unlink("test.db"); my $database = DBM::Deep->new( file => "test.db", locking => 1, autoflush => 1 ); # Test array that contains a hash reference as an element my @array = ("Mac Address", "PCNAME", 1, 1187000400, { 'bob' => 23, 'alice' => 20 }); print("\@array\n", Dumper(\@array)); # Shows the contents of the array, with no blessed references and nothing tied to the DBM::Deep database $database->{141} = \@array; # Assigns the array reference as a value of the DBM::Deep database hash print("\@array\n", Dumper(\@array)); # Now the original array's internal hash is tied or blessed or something to the database my $temp = $database->{141}->export; # Export should return a reference to an array in which the internal hash is not tied to the database anymore print("\$temp\n", Dumper($temp)); # Dumper shows no tied or blessed hash; seems like it worked. my @new_array = @{ $temp }; # Dereferencing the array reference to reconstitute the array. print("\@new_array\n", Dumper(\@new_array)); # The new array's hash reference is normal. @array = @{ $temp }; # Assigning the array reference to the original array variable.. should work fine. print("\@array\n", Dumper(\@array)); # This prints a hash reference that is still tied to the database. WTF? my @array = @{ $temp }; # Assigning the array reference to the original array variable but redeclaring it using my. print("\@array\n", Dumper(\@array)); # This works... Why is redeclaring the variable important? Why doesn't the reassignment work?