in reply to How do I load a hash table?
Maybe I'm totally misunderstanding you, but I'm envisioning that you have a HoH structure like this:
my %macs = ( '00:11:22:33:44:55' => { 'response_status' => 12, 'response_date' => 'yesterday', }, 'AA:BB:66:12:13:14' => { 'response_status' => 0, 'response_date' => '2004-12-31', }, # ... and so on );
And you get some user input, then you look up the data you want:
my $mac = <STDIN>; chomp $mac; if ( exists $macs{$mac} ) { print "Okay, found mac $mac:\n"; print "response_status: $macs{$mac}{response_status}\n"; print "response_date: $macs{$mac}{response_date}\n"; } else { print "Sorry, don't recognize that mac\n"; }
Is that what you meant?
|
---|
Replies are listed 'Best First'. | |
---|---|
A reply falls below the community's threshold of quality. You may see it by logging in. |