in reply to Re: Re: dbmopen() test if file exists already?
in thread dbmopen() test if file exists already?
I was thinking about some data structure where, for example, user details could be stored in that kind of tied hash, and so you might want to check if you already had a "codypendant.db" or a "broquaint.db" when a new user came along, in case of duplication.This sounds like a case for creating a single hash, where each user is a key, then it would just be a matter testing the existence of a user with exists %user_db. If however, you've decided to do it on a per file basis for whatever reason then it would just be a matter of testing the return status of dbmopen e.g
dbmopen(my %hash, "codypendant") and warn "codypendant already exists";
_________
broquaint
|
|---|