in reply to Re: Having an Issue updating hash of hashes
in thread Having an Issue updating hash of hashes

Thank you. That worked. For clarity here is the final code:
#!/usr/bin/perl use Data::Dumper; use strict; use warnings; getPeople(); sub getPeople { my ( $id, $first, $last, $age ); my $file = 'list.txt'; my $people; my $cntr; open( LIST, "< $file" ) or die "Can't open $file : $!"; #my @lines = split /\n/, $str; #foreach my $line (@lines) { while (my $row = <LIST> ) { $cntr++; my ($id, $first, $last, $age ) = split( /\s/, $row ); $id = (split( /=/, $id ))[1]; $first = (split( /=/, $first ))[1]; $last = (split( /=/, $last ))[1]; $age = (split( /=/, $age ))[1]; $people -> { "$id" } = { 'id' => "$id", 'first' => "$first", 'last' => "$last", 'age' => "$age" }; } print Dumper($people); print "The person with ID 3 is $people->{'3'}{'first'} $people->{'3'}{ +'last'}\n"; close LIST; }