$Id: readme.txt,v 1.1.1.1 2005/11/26 21:12:50 shurring Exp $ $Date: 2005/11/26 21:12:50 $ ========================================================= README for "serialize.pm" v0.9 -- Last Update: [13-Apr-04] Perl workalike of PHP's serialize() and unserialize() functions. Will turn a hash or array (even nested hashes/arrays) into a serialized string that is fully compatible with PHP's serialize() and unserialize() functions. Unlike other perl modules that make use of binary formats, the output from serialize() is a string, meaning you can easily manipulate it as you would any other string, include sticking it into a URL, a database, a file, or any other location that a string can go. It's particularly useful when PHP and perl scripts both have to share un-structured data. For example: Data can be serialize()d in perl with this module, stored in a database (or file), and then unserialized() with PHP -- or vice-versa -- or you can use this module exclusively with Perl. You do NOT need PHP to use this module. version: v0.9 authour: Scott Hurring [scott (at) hurring.com] address: http://hurring.com/code/perl/serialize/ What's supported: (data only) Strings, Integers, Arrays, Doubles, Hashes, Arrays (can be nested, but references will probably get mutilated) What's not: (non-data things) Objects, Code Blocks, References, etc... (Basically, anything that is not pure data will not properly transfer between lang's) I have verified this code against the following PHP versions: v4.0.6, 4.5.0, 4.1.2 To my knowledge, this code is in complete agreement with PHP's current serialize() implementation (all data that i've tested with has seamlessly worked when using PHP or this perl module) This is a perl workalike of PHP's serialize() and unserialize() commands. As far as i can tell, it serialize()s and deserialize()s strings, numerics, arrays, hashes identically to the PHP functions of the same name. Thus, you should be able to transfer data between Perl and PHP with extreme ease, using serialize() and deserialize() as an intermediary. I use this module mostly when i'm working with mixed PHP and Perl code that has to access the *same* data in a database. By using serialize() on hashes/arrays before writing to the database, it's a cinch to pull that info. out of the database and then deserialize() it with whatever language you happen to be using. ========================================================= This is free code: you can use it however you want; on two conditions: 1) You must include this text with the re-distributed module that contains my email address and the names/addresses of those who have contributed to this module. Written by: Scott Hurring [scott (at) hurring.com] http://hurring.com/ With contributions/suggestions/bugfixes from: (see changelog.txt for info. about what was contributed by whom) Erlend Str?msvik [ehs (at) vorfor.no] Konrad Stepien [konrad (at) interdata.net.pl] Ron Grabowski [ronnie (at) catlover.com] Joel A. Chornik [joel (at) elserver.com] Julian Jares [jjares (at) uolsinectis.com.ar] 2) You do not charge any money for this product without prior written consent from me. Non-commercial and educational use is completely free. ========================================================= Disclaimer: I make no guarantee as to the functionality (or correctness) of the values produced with this code when used with serialized deserialized values from other versions of PHP than the ones i've specifically tested (although it seems quite absurd for PHP to go and radically change the output of serialize()) The code is the product of one mind. It works great for me, but different coders with different styles will definately see ways to optimize and/or improve my code. If you see room for improvement, i would really love it if you sent me an email with suggestions and/or code fixes. I have been concentrating on copying PHP's functionality more than making the code fast, so please don't expect this module to come anywhere near the speed of PHP's native serialize() and unserialize()