#!/usr/local/apps/perl/bin/perl ############################################################################# # # # WHO: John L. Moreland # # # # WHAT: each3 # # # # WHY: Demonstrates the use of the "each" function for DBM files. # # # # WHERE: Opus Software # # # # WHEN: Mon Sep 21 20:32:24 PDT 1998 # # # # HOW: PERL # # # ############################################################################# dbmopen %each3, "each3", 0666; while ( chop( $line = ) ) { ( $key, $value ) = split( /\s+/, $line ); $each3{$key} = $value; } while ( ($key, $value) = each %each3 ) { $key =~ s/\0//g; $value =~ s/\0//g; print "$key = $value\n"; } dbmclose %each3;