#!/usr/local/apps/perl/bin/perl ############################################################################# # # # WHO: John L. Moreland # # # # WHAT: each2 # # # # WHY: Demonstrates the use of the "each" function for DBM files. # # # # WHERE: Opus Software # # # # WHEN: Mon Sep 21 20:31:54 PDT 1998 # # # # HOW: PERL # # # ############################################################################# dbmopen %each2, "each2", 0666; $each2{a} = "Ape"; $each2{b} = "Bat"; $each2{c} = "Cat"; while ( ($key, $value) = each %each2 ) { $key =~ s/\0//g; $value =~ s/\0//g; print "$key = $value\n"; } dbmclose %each2;