Guildencrantz has asked for the wisdom of the Perl Monks concerning the following question:
I have linked a DB file with a hash and have tried to apply the exists function to it. For some reason I am getting the error: "AnyDBM_File doesn't define an EXISTS method at /var/www/cgi-bin/ds/deactivate.pl line 18". I even checked the Perl Cookbook and it reports that this is a valid function. What am I doing wrong?
~~Guildencrantz#!/usr/bin/perl -wT # # Script: Dynamic Dungeon Siege IP Database Deactivate IP Script # Author: Guildencrantz # Version: 4-13-02 # use strict; use CGI::Carp 'fatalsToBrowser'; my $userIP = $ENV{REMOTE_ADDR}; my $activeIPsPath = "/var/www/cgi-bin/ds/database/activeIPs"; dbmopen(my %activeIPs, $activeIPsPath, 0666) or die "Cannot open activeIPs database: $!"; if(exists $activeIPs{$userIP}) { delete($activeIPs{$userIP}); ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Exists with DBM
by grep (Monsignor) on Apr 13, 2002 at 21:36 UTC | |
|
Re: Exists with DBM
by Juerd (Abbot) on Apr 13, 2002 at 21:19 UTC | |
|
Re: Exists with DBM
by Guildencrantz (Sexton) on Apr 13, 2002 at 22:50 UTC | |
by grep (Monsignor) on Apr 14, 2002 at 00:14 UTC | |
|
(crazyinsomniac) Re: Exists with DBM
by crazyinsomniac (Prior) on Apr 14, 2002 at 10:36 UTC |