#!/usr/bin/perl -w #use 5.010; use strict; use warnings; use Getopt::Std; use Data::Dumper; my $usage; { $usage = <<"_USAGE_"; _USAGE_ } my %opts = (); getopts('h',\%opts); if ($opts{h}) { print $usage; exit; } #Crea la matrice di NON_CONCETTI my $prefix = shift; my $input = shift; #matrice_ridotta my $input_coppie =shift; #coppiediparole my $file = $prefix . ".txt"; if (-e $file) { print STDERR "$file already exists, deleting previous version\n"; `rm -f $file`; } open INPUTCOPPIE, $input_coppie; my %map; while () { my ($first, $second) = split; $map{$first}=$second; } close INPUTCOPPIE; #print Dumper \%map; open INPUT, $input; my %HOH; while () { my ($nome, $c1, $c2, $c3) = split; my $prop = $c1."_".$c2; $HOH{$nome}{$prop} = $c3 || 0; } close INPUT; my ($first, $second,$int); my %hashintermedio; while (my($ele,$coord)=each(%map)){ if (exists $HOH{$ele}){ $first=$HOH{$ele}; if(exists $HOH{$coord}){ $second=$HOH{$coord}; while (my ($prop,$score)=each %$second){ } } } } while (my($ele,$coord) = each (%map)) { if (exists $HOH{$ele}){ $first = $HOH{$ele}; if (exists $HOH{$coord}){ $second = $HOH{$coord}; while (my($prop,$score) = each %$second ) { if (not exists $first->{$prop}){ $hashintermedio{$int}{$prop}=$score } else } } } else { next; } }