Sponsored Content
The Lounge What is on Your Mind? Should We Cancel Spotify in Support of Neil Young? Post 303046378 by Neo on Sunday 30th of January 2022 12:30:18 AM
 

2 More Discussions You Might Find Interesting

1. Solaris

I am too young not to be able to resolve myself...nslookup problem (no DNS available)

I don't have DNS, and would like to resolve EVERYTHING through local /etc/hosts file. My first sunbox has the following configuration: # hostname mybox.home.com My host file is as follows: # cat /etc/hosts # # Internet host table # 127.0.0.1 localhost 192.25.x.x ... (6 Replies)
Discussion started by: mr_manny
6 Replies

2. What is on Your Mind?

I Am Calling All Unix Experts Young Mind In Need

My name is Courtney Robinson, and I am just a young man trying to figure out were he wants his life to head. I am currently in school for Computer Science and have once class left and jsut figured out I hate programming. However I am in love with Storage (SAN), UNIX, LINUX. I want to learn more.... (10 Replies)
Discussion started by: Courtney3216
10 Replies
Data::Serializer::Raw(3pm)				User Contributed Perl Documentation				Data::Serializer::Raw(3pm)

NAME
Data::Serializer::Raw - Provides unified raw interface to perl serializers SYNOPSIS
use Data::Serializer::Raw; $obj = Data::Serializer::Raw->new(); $obj = Data::Serializer::Raw->new(serializer => 'Storable'); $serialized = $obj->serialize({a => [1,2,3],b => 5}); $deserialized = $obj->deserialize($serialized); print "$deserialized->{b} "; DESCRIPTION
Provides a unified interface to the various serializing modules currently available. This is a straight pass through to the underlying serializer, nothing else is done. (no encoding, encryption, compression, etc) EXAMPLES
Please see Data::Serializer::Cookbook(3) METHODS
new - constructor $obj = Data::Serializer::Raw->new(); $obj = Data::Serializer::Raw->new( serializer => 'Data::Dumper', options => {}, ); new is the constructor object for Data::Serializer::Raw objects. o The default serializer is "Data::Dumper" o The default options is "{}" (pass nothing on to serializer) serialize - serialize reference $serialized = $obj->serialize({a => [1,2,3],b => 5}); This is a straight pass through to the underlying serializer, nothing else is done. (no encoding, encryption, compression, etc) deserialize - deserialize reference $deserialized = $obj->deserialize($serialized); This is a straight pass through to the underlying serializer, nothing else is done. (no encoding, encryption, compression, etc) serializer - change the serializer Currently supports the following serializers: Bencode(3) Convert::Bencode(3) Convert::Bencode_XS(3) Config::General(3) Data::Denter(3) Data::Dumper(3) Data::Taxi(3) FreezeThaw(3) JSON(3) JSON::Syck(3) PHP::Serialization(3) Storable(3) XML::Dumper(3) XML::Simple(3) YAML(3) YAML::Syck(3) Default is to use Data::Dumper. Each serializer has its own caveat's about usage especially when dealing with cyclical data structures or CODE references. Please see the appropriate documentation in those modules for further information. options - pass options through to underlying serializer Currently is only supported by Config::General(3), and XML::Dumper(3). my $obj = Data::Serializer::Raw->new(serializer => 'Config::General', options => { -LowerCaseNames => 1, -UseApacheInclude => 1, -MergeDuplicateBlocks => 1, -AutoTrue => 1, -InterPolateVars => 1 }, ) or die "$! "; or my $obj = Data::Serializer::Raw->new(serializer => 'XML::Dumper', options => { dtd => 1, } ) or die "$! "; store - serialize data and write it to a file (or file handle) $obj->store({a => [1,2,3],b => 5},$file, [$mode, $perm]); or $obj->store({a => [1,2,3],b => 5},$fh); Serializes the reference specified using the serialize method and writes it out to the specified file or filehandle. If a file path is specified you may specify an optional mode and permission as the next two arguments. See IO::File for examples. Trips an exception if it is unable to write to the specified file. retrieve - read data from file (or file handle) and return it after deserialization my $ref = $obj->retrieve($file); or my $ref = $obj->retrieve($fh); Reads first line of supplied file or filehandle and returns it deserialized. AUTHOR
Neil Neely <neil@neely.cx>. http://neil-neely.blogspot.com/ BUGS
Please report all bugs here: http://rt.cpan.org/Public/Dist/Display.html?Name=Data-Serializer COPYRIGHT AND LICENSE
Copyright (c) 2011 Neil Neely. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available. See http://www.perl.com/language/misc/Artistic.html ACKNOWLEDGEMENTS
Peter Makholm took the time to profile Data::Serializer(3) and pointed out the value of having a very lean implementation that minimized overhead and just used the raw underlying serializers. SEE ALSO
perl(1), Data::Serializer(3). perl v5.12.4 2011-08-16 Data::Serializer::Raw(3pm)
All times are GMT -4. The time now is 04:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy