#! /usr/bin/perl -w use strict; my %hash_1 = ( 0.2 => '12', 0.4 => '13', 0.6 => '14', ); my %hash_2 = ( 0.2 => '19', 0.4 => '18', 0.6 => '20', ); foreach my $ObsKey ( sort { $a <=> $b } keys %hash_1 ) { foreach my $PermKey ( sort { $a <=> $b } keys %hash_2 ) { my $diff_obs_perm = $hash_1{$ObsKey}-$hash_2{$PermKey}; my $FDR = $hash_2{$PermKey} / $hash_1{$ObsKey}; my $currentdeltaprint = join ("\t", $ObsKey, $hash_1{$ObsKey}, $hash_2{$PermKey}, $diff_obs_perm, $FDR ); print "$currentdeltaprint\n"; } }