Re: [Cgi-session-user] CGI::Session::Serialize::yaml
Brought to you by:
sherzodr
From: Mark S. <ma...@su...> - 2006-02-15 23:23:15
|
On Wed, Feb 15, 2006 at 02:01:58PM -0800, Tyler MacDonald wrote: > YAML is a notation that represents classes, objects, arrays, hashes, and > scalars. Perl, PHP, Ruby, Python, and other languages can serialize to and > from YAML. > > I have written a very simple CGI::Session::Serialize class that serializes > to/from YAML: > > http://search.cpan.org/~CRAKRJACK/CGI-Session-Serialize-yaml-1.0/lib/CGI/Session/Serialize/yaml.pm > > It uses the fast C-based YAML::Syck when available, or the pure-perl YAML.pm > otherwise. > > Combining this serializer with, say, a MySQL or Postgres driver opens up the > door for CGI::Session objects to be shared with other dynamic languages. I'm > currently using this for a project that is going to have a mod_perl2 > low-level authentication backend, but possibly some PHP pages in the actual > webspace. > > I'd really like to see something like this make it into the main > CGI::Session distribution. Working with multiple languages at once is > becoming more and more common. I uploaded it to CPAN mainly because I'm > going to be releasing a module that needs it soon; if a YAML serializer > makes it into CGI::Session itself (a non-dev release), I'd remove mine from > CPAN and update my module to depend on the latest CGI::Session. Tyler, I'm a YAML fan too, as well as CGI::Session co-maintainer. How about this: We include the YAML serialize in the core distribution, but you agree to maintain it, should changes be needed. SVN access can be furnished for that purpose. I originally wrote the "PureSQL" driver because I wasn't comfortable putting a Perl data structure in the database. It seems wrong, in part because of the cross-language access that you mention. I do currently using the PostgreSQL for pragmatic reasons, but I would still prefer the data be stored in a more accessible format internally, which YAML accomplishes. Mark |