use strict; use feature "switch"; open my $outfh, '>:encoding(utf8)', 'user-list.txt'; my %NOT_COLLECTED; my @UNCLASSIFIED_FILE; sub print_not_collected { print $outfh "-----------------------------------------\n"; for (keys %NOT_COLLECTED) { print $outfh $_ . ' ' . join(' ', keys %{+{map +($_ => undef), @{$NOT_COLLECTED{$_}}}}) . "\n"; } print $outfh "-----------------------------------------\n"; print $outfh join "\n", @UNCLASSIFIED_FILE; close($outfh); exit(0); } use sigtrap 'handler' => \&print_not_collected, qw(INT QUIT); my @tmp_PIV; while(<user-pivot-*.txt>) { my ($class) = /\d+/g; open my $ph, "<:encoding(utf8)", $_; push @tmp_PIV, \%{+{map {/(.*)/; $1=>$class} grep /.+/, <$ph>}}; } my %DUP; for my $i (0..$#tmp_PIV-1) { for my $j ($i+1..$#tmp_PIV) { for (keys %{$tmp_PIV[$i]}) { $DUP{$_}{$tmp_PIV[$i]{$_}} ...
Ideas y proyectos de informática.