in reply to Strange GDBM behavior
Here is the writer.
And a reader#!/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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Strange GDBM behavior
by wink (Scribe) on Jul 22, 2005 at 04:44 UTC |