#!/usr/bin/perl -w # use perl; use DB_File; use DBI; use File::Basename qw(basename); use strict; my @nochosts = qw(); my $qdir = '/var/www/noc.mydomain.com-80/'; push @nochosts, 'nocmail01'; foreach my $noc (@nochosts) { my $file = sprintf('%s/%s/%02x.db', $qdir, $noc, 170); print "file: $file\n"; tie (my %hash, 'DB_File', $file, O_RDWR, 0600, $DB_HASH) || die "Cannot tie $file\n"; print "tie finished\n"; foreach my $key ( keys %hash ) { print "processing key: $key\n"; } untie %hash; }