use FreezeThaw qw(freeze thaw); # Import freeze() and thaw()
# Create sample object
open(species_ncbi_list, "species_ncbi_list") || die "Error: file 'species_ncbi_list' can not be opened\n";
%species_ncbi_hash;
while(<species_ncbi_list>){
	$entry = $_;
	# strip off newline characters
	chomp $entry;
	$entry =~ s/\r//g;
	$entry =~ s/\n//g;
  # split the columns into 3 separate variables
	($ncbi_id, $species) = split("\t", $entry);
      
	# skip
	next if(!defined($species) || !defined($species));
	$species_ncbi_hash{"$ncbi_id"}="$species";
}
$msg = freeze(%species_ncbi_hash);
open(File,"> frozenHash") || die "couldn't open file";
syswrite (File, $msg, length($msg));
print "successfully written into the file\n";
open(frozenHash, "frozenHash") || die "Error: file frozenHash can not be opened\n";
while(<frozenHash>){
	$entry = $_;
}
	%deserialized_data = %{ thaw($entry) };	
print length(%deserialized_data);
while(($key, $value) = each(%deserialized_data)) {
		print "something \n";
    # do something with $key and $value
    print "$key : $value \n";
}
	
	
	
	
