develooper Front page | perl.perl6.announce.rfc | Postings from September 2000

RFC 287 (v2) Improve Perl Persistance

Perl6 RFC Librarian
September 30, 2000 23:48
RFC 287 (v2) Improve Perl Persistance
Message ID:
This and other RFCs are available on the web at

=head1 TITLE

Improve Perl Persistance

=head1 VERSION

  Maintainer: Adam Turoff <>
  Date: 24 Sep 2000
  Last Modified: 30 Sep 2000
  Mailing List:
  Number: 287
  Version: 2
  Status: Frozen


Many mechanisms exist to make perl code and data persistant.  They should
be cleaned up, unified, and documented widely within the core


Tom Christiansen proposed this in his perl6storm message:

	=item perl6storm #0022

	make marshalling easy.  core module?  would this allow for easy
	persistence of data structures other than dbm files?
	general persistence is hard, right?  can this be an attribute?

Python offers one way to make code/data persistant: the C<pickle> interface.
More complex serialization can be accomplished through the 'shelve'
interface or DBM files.  This capability is quite useful, widely known and
easily used.

Perl, by comparison, offers Data::Dumper, which can serialize Perl objects
that are rather asymetrically reconstituted by using C<eval> or C<do>.  
Perl also offers solid, simple interfaces into DBM and Berkeley DB files,
and offer a well known, low-level serialization mechanism.  

CPAN offers many other serialization modules that are only slightly
different than Data::Dumper.  This plethora of serialization mechanisms
confuses users and adds to code bloat when multiple modules each use
different serialization mechanisms that are all substantially similar.

Something similar to Python's C<pickle> interface should be added into Perl
as a builtin; this feature should have a symmetric "restore" builtin (eg 
save()/restore(), freeze()/thaw(), dump()/undump()...).

Furthermore, Perl's low level serialization machinery (DBM, SDBM, GDBM,
Berkeley DB) should be unified into a single core module, where the
underlying DBM implementations are pluggable drivers, like DBI's DBD


First, the issue of adding builtin serialization functions needs to be
addressed.  This is a language issue because serialization should be more
visible than it is today, and the best way to accomplish that is to include
this feature as a pair of builtin functions.  

If this feature is implemented through a core module, that module might
best be presented as a pragmatic module.

Finally, although this proposal describes a simple matter of programming,
some of the issues (such as pluggable interfaces) are best hashed out at a
language-design level, so that they may be used elsewhere, easily.


Python Pocket Reference, Chapter 12

perl6storm Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About