in reply to Unique Hash name for each pass
files one and two#!/usr/bin/perl use warnings; use strict; my @files = get_files(); my %single_hash; for my $file (@files){ open my $fh, q{<}, $file or die qq{open to read $file failed: $!\n}; my $file_as_string = do{local $/;<$fh>}; push @{$single_hash{$file_as_string}}, $file; } for my $value (values %single_hash){ print qq{@{$value}\n}; } sub get_files{ # stuff return qw{one two three}; }
file threeone two three four
outputone two three four five
Two files (one and two) are the same i.e. not unique. Am I warm?three one two
|
|---|