in reply to Re: Hash of Array references
in thread Hash of Array references
It worked great. But how can I access the respective $user and $comments independetly?
print 'Select a number: '; my $input = <STDIN>; chomp $input; if (exists $users{$input}) { print "Number entered is : $users{$input} \n"; print "User for the number $users{$input} is : \n"; print "Comments for the number $users{input} is : \n"; } else { print "Unknown number.\n"; }
Something like this in the output
Number entered is : 12345678 User for number 123456789 is : Sam Comments for the number 123456789 is : Changed "abc" in the file
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Hash of Array references
by choroba (Cardinal) on Aug 04, 2014 at 15:08 UTC | |
by sravs448 (Acolyte) on Aug 04, 2014 at 15:24 UTC | |
by choroba (Cardinal) on Aug 04, 2014 at 15:42 UTC |