You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
374 B
Perl

#!/usr/bin/perl
use strict;
use warnings;
use AnyDBM_File;
use POSIX;
my %dbm;
my $db_file="anydbmdemo.dbm";
tie (%dbm, 'AnyDBM_File', $db_file, O_CREAT|O_RDWR, 0644);
unless (tied %dbm) {
print "Error opening $db_file $!\n";
} else {
$dbm{'Created'}=localtime;
foreach (sort keys %dbm) {
print "$_ => $dbm{$_}\n";
}
untie %dbm;
}