#!/usr/bin/perl use GDBM_File; my %ports; tie(%ports,'GDBM_File','gdbmtest',&GDBM_NEWDB,0644) or die "$!\n"; for my $switch (0 .. 5) { for my $ifnum (0 .. 5) { $ports{"$switch:$ifnum"} = "test $switch $ifnum"; } } untie(%ports) or warn "$!\n"; #### #!/usr/bin/perl use GDBM_File; my %ports; tie(%ports,'GDBM_File','gdbmtest',&GDBM_READER,0644) or die "$!\n"; for my $switch (0 .. 5) { for my $ifnum (0 .. 5) { print $ports{"$switch:$ifnum"}, "\n"; } } untie(%ports) or warn "$!\n";