On Thu, Aug 24, 2000 at 08:29:21PM -0000, Perl6 RFC Librarian wrote:
> The C<dbmopen> and C<dbmclose> commands are legacy commands which have been
> deprecated for at least 5 years.  They should be removed from the language.

Two nit picks.

First, dbmopen() isn't deprecated.

    [This function has been largely superseded by the tie() function.]
                --perlfunc

Deprecated, no.  Redundant, yes.  And Perl has *never* had two ways to
do things. ;)


Secondly, I still use dbmopen().  I find it a much simpler interface
than AnyDBM_File when I just need any ol' disk hash.

Compare:

        dbmopen(%foo, 'somefile', 0644);

with:

        use AnyDBM_File;
        use Fcntl;

        tie %hash, 'AnyDBM_File', 'somefile', O_RDWR|O_CREAT, 0644;

dbmopen()'s interface is much shorter and its much, much easier to
understand.  Try explaining O_RDWR|O_CREAT to a newbie.  People have
enough trouble with 0644.


Now, this doesn't mean dbmopen() has to remain as a builtin.  It could
be written as a pure Perl wrapper around tie() and AnyDBM_File.  But
keep it somewhere.  Its useful and its not bothering anyone.


-- 

Michael G Schwern      http://www.pobox.com/~schwern/      [EMAIL PROTECTED]
Just Another Stupid Consultant                      Perl6 Kwalitee Ashuranse
But unluckily most Germans here are too smart.  They all speak good English
and won't be able to speak German to me.
             --Alex Chiu, Immortality Guy

Reply via email to