use strict;
use warnings;
#this script we define the third basic variable: HASH, %. It's indexed array--let's put it that way

my $id1="whatever_id1";
my $seq1="ATAATROFHJKDGHJFKFGDHJ";
my $id2="whatever_id2"; 
my $seq2="ATAATROFHJKDGHJFKFGDHJKPLUS"; 


#define first hash by giving the key (whatever_id1) and value ($seq1)
my %hash={whatever_id1=>"ATAATROFHJKDGHJFKFGDHJ"};


# or define (add) key/value this way ($is used at beginning because hash{$id2} points to a scalar)
$hash{$id2}=$seq2; 

#get the unique index of the hash: so called key
my @keys=keys %hash; 
print @keys "\n"; 


#get the content of the hash: so called values
my @values=values %hash; 
print @values, "\n";



#remember the keys and contents are given as array so you do some operation on it:
foreach my $key (@keys)
{
print $key, " ", $hash{$key}, "\n";
}



#reverse hash so keys become values and vice versa: however be careful as contents can be identical while keys are different: you might lose some former keys 
print reverse %hash; 
