[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-AnyPerl] About This .pm Stuff



At 21:27 -0400 4/30/1999, Chris Nandor wrote:
>In this case, you should use the AnyDBM_File module.  It works almost
>exactly like the DB_File module, but will work on any perl platform (using
>whatever DBM module happens to be available).

I tried this and it indeed works fine. Thanks.

BTW, I am using this to tie a hash and I have a couple of questions:

1. I am using a text file as the data source. I read it into an 
array, split, do the the tie, then load the tied hash with the array. 
Is there a way to read the text file directly into the hash without 
passing it thru an array first?

2. The tie statement is supposed to be creating a file that I called 
source.dbm in a particular directory, but nothing is there. I am using
tie (%thehash, '/home/source.dbm', O_ RDWR|O_CREAT, 0644)
and assumed that if Perl couldn't find the existing file, it would 
create it and that I could skip reading the original text file from 
another directory into an array in the future because it would be 
persistent. What am I missing here?

3. Once the hash is tied and I do a search for a key, it works fine 
unless the case of part of the search string doesn't match the case 
of the key. This stuff was originally published for print, not web, 
use and it's not unusual for case to be inconsistent. Is there a way 
to control case sensitivity when searching keys in the same way that 
you might with m//i?

Thanks.


Richard Gordon
--------------------
Gordon Consulting & Design
Database Design/Scripting Languages
mailto://maccgi@bellsouth.net
770.565.8267

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-anyperl-request@macperl.org