in reply to Re^2: how to push multiples row of values into hash and do comparison
in thread how to push multiples row of values into hash and do comparison
It would help to actually read the file data (untested change)
sub gethash { my $fh = shift; local $/; local $_ = <$fh>; s/^\s+//gm; s/[\t]+/\t/g; my %hash; while(/^name\s+(\S+)\n(num.*\n)*/gm ) { my $name = $1; $hash{$name} = [$& =~ /^num\s*(.*)/gm ]; } return %hash; }
|
|---|