use Data::Dumper; my %rate; foreach my $row ( $dom->findnodes('//table/tr') ) { my $key = $row->findvalue('./td[1]'); $rate{$key} = $row->findvalue('./td[2]'); } print Dumper(\%rate);
$VAR1 = { 'GBP' => '0.3801', 'AUD' => '0.9269', 'USD' => '0.7318' };