Rene Schickbauer > Maplat-0.995 > Maplat::Helpers::DBSerialize

Download:
Maplat-0.995.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.995   Source  

NAME ^

Maplat::Helpers::DBSerialize - serialize data structures for saving them into a database text field

SYNOPSIS ^

  use Maplat::Helpers::DBSerialize;
  
  my $textstring = dbfreeze($reftodata);
  my $reftodata = dbthaw($textstring);

DESCRIPTION ^

This module provides functions to encode data structures in a way so they can be saved to non-binary text strings in databases (like the "text" data type in PostgreSQL).

Internally, it uses Storable and MIME::Base64 to do its job.

dbfreeze

Takes one argument, the reference to the data structure to be encoded. Returns a text string.

dbthaw

Takes one argument, a text string encoded by dbfreeze(). Returns a reference to a data structure.

dbderef

Takes one argument, a scalar that (possibly) needs derefencing. This is a helper function that should(tm) do the right things in most of the cases and return the correctly derefenced scalar. YMMV

AUTHOR ^

Rene Schickbauer, <rene.schickbauer@gmail.com>

COPYRIGHT AND LICENSE ^

Copyright (C) 2008-2011 by Rene Schickbauer

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: