xorl has asked for the wisdom of the Perl Monks concerning the following question:

I've got a client who wants me to hack up their install of MoveableType however Sixapart's support forums have a bandwith exceeded error, so I'm going to ask here.

Basically there is a blob in the database which is the output from Storable.pm. Now the client wants a PHP script to query the db directly based on the information in that blob field. Is there a good way to get the data out of Storable.pm's output without using Perl?

So far the only think I can think of doing is running a Perl script to thaw the blob and then write it into some simple format that I can then use in PHP.

If there is something like an Idiot's guide to Storable.pm format, I'd love to find it (or maybe someone here can give a brief overview). I don't at all understand the format used by Storage.pm, which makes this a zillion times more difficult.

Thanks.

Edit:Fixed typo in module name. Thanks gellyfish.

  • Comment on [OT] Use a Storable.pm object without Perl

Replies are listed 'Best First'.
Re: Use a Storage.pm object without Perl
by ikegami (Patriarch) on Aug 16, 2006 at 14:47 UTC
    So far the only think I can think of doing is running a Perl script to thaw the blob and then write it into some simple format that I can then use in PHP.

    Sounds like a great idea. You could use JSON as the new format. It has libraries in Perl, PHP and a number of other languages. As a bonus, it should even be human readable.

Re: [OT] Use a Storage.pm object without Perl
by gellyfish (Monsignor) on Aug 16, 2006 at 14:49 UTC

    Do you mean Storable? If so it could be possible to factor out the code from Storable.xs that reads the stored into a C library that can be used from other languages. Finding how to represent the perl types would be the tricky part of course.

    /J\

        YAML does objects!
        #!/usr/bin/perl use CGI; use YAML; $q = CGI->new; $q->param(sex,'good'); print Dump($q); $d = Dump($q); $re = Load($d); print Dump($re);
Re: [OT] Use a Storable.pm object without Perl
by Cody Pendant (Prior) on Aug 17, 2006 at 05:19 UTC
    Just because nobody's suggested it yet, how about that new Xtensible Markup Language the kids are using these days? Use XML::Dumper to turn your Perl into XML. PHP can read XML these days, right?


    ($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
    =~y~b-v~a-z~s; print