Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Storable: :freeze: Can php thaw?

by cormanaz (Deacon)
on Oct 17, 2009 at 17:34 UTC ( [id://801772]=perlquestion: print w/replies, xml ) Need Help??

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

Howdy bros. I have an application that mixed perl/php and I'm wondering if anyone knows if/how I can thaw a mod Storable blob in php.

TIA...

Steve

Replies are listed 'Best First'.
Re: Storable: :freeze: Can php thaw?
by bv (Friar) on Oct 17, 2009 at 17:49 UTC

    Google Says both no and yes. General consensus is that you should pick a more portable storage method such as YAML or JSON, but this guy claims to have written a PHP version of the Storable interface. Not sure whether it will actually work, but it's a place to start

    print pack("A25",pack("V*",map{1919242272+$_}(34481450,-49737472,6228,0,-285028276,6979,-1380265972)))
      Well I investigated this. It only has store and retrieve methods (i.e. for data serialized to file) not freeze/thaw. I did not test the retrieve function, but it looks pretty straightforward--it parses the file and uses a php unserialize function to put it back into a data structure.

      I tried to see if I could feed the frozen object to that function, because I suppose in principle that out to work. Unfortunately it expects a string and the frozen object is binary, and I'm not enough of a php wizzard to figure out how to decode it two bytes at a time to a string--if that's even possible.

      Thanks bv. Yeah it would be better to use YAML or JSON but unfortunately the data already exists in Storable.

      I looked around on Google before I posted here, don't know how I missed that one.

      I will update once I find out if it works.

      JSON/YAML route ftw on this I think. Human readable and it's well supported on each end.

      mtfnpy

Re: Storable: :freeze: Can php thaw?
by Corion (Patriarch) on Oct 17, 2009 at 18:19 UTC

    If you're not bound to Storable, there is PHP::Session that can write PHP session files. So if you can store your data in PHP sessions, you can read them from PHP (duh) and from Perl.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://801772]
Approved by Marshall
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-03-28 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found