Rob Kinyon > DBM-Deep-1.0001 > DBM::Deep::Cookbook

Download:
DBM-Deep-1.0001.tar.gz

Annotate this POD

CPAN RT

New  9
Open  2
View Bugs
Report a bug
Source   Latest Release: DBM-Deep-1.0014

NAME ^

DBM::Deep::Cookbook

DESCRIPTION ^

This is the Cookbook for "" in DBM::Deep. It contains useful tips and tricks, plus some examples of how to do common tasks.

RECIPES ^

UTF8 data

When you're using UTF8 data, you may run into the "Wide character in print" warning. To fix that in 5.8+, do the following:

  my $db = DBM::Deep->new( ... );
  binmode $db->_fh, ":utf8";

In 5.6, you will have to do the following:

  my $db = DBM::Deep->new( ... );
  $db->set_filter( 'store_value' => sub { pack "U0C*", unpack "C*", $_[0] } );
  $db->set_filter( 'retrieve_value' => sub { pack "C*", unpack "U0C*", $_[0] } );

In a future version, you will be able to specify utf8 =gt 1 and "" in DBM::Deep will do these things for you.