GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Storable::AMF0(3) User Contributed Perl Documentation Storable::AMF0(3)

Storable::AMF0 - serializing/deserializing AMF0 data

  use Storable::AMF0 qw(freeze thaw); # or use Storable::AMF3 qw(freeze thaw) for AMF3 format
  $amf0 = freeze($perl_object);
  $perl_object = thaw($amf0);
        
  # Store/retrieve to disk amf0 data
        
  store $perl_object, 'file';
  $restored_perl_object = retrieve 'file';
  use Storable::AMF0 qw(nstore freeze thaw dclone);
  # Network order: Due to spec of AMF0 format objects (hash, arrayref) stored in network order.
  # and thus nstore and store are synonyms 
  nstore \%table, 'file';
  $hashref = retrieve('file'); 
  
  # Advisory locking
  use Storable::AMF0 qw(lock_store lock_nstore lock_retrieve)
  lock_store \%table, 'file';
  lock_nstore \%table, 'file';
  $hashref = lock_retrieve('file');
  # Deparse one object
  use Storable::AMF0 qw(deparse_amf); 
  my( $obj, $length_of_packet ) = deparse_amf( my $bytea = freeze($a1) . freeze($a) ... );
  - or -
  $obj = deparse_amf( freeze($a1) . freeze($a) ... );
  # JSON::XS boolean support
  
  use JSON::XS;
  $json =  encode_json( thaw( $amf0, parse_serializator_option( 'json_boolean' ))); #  
  $amf_with_boolean = freeze( $JSON::XS::true  or $JSON::XS::false);
  
  # boolean support;
  use boolean;
  $amf_with_boolean = freeze( boolean( 1 or '' ));
  # Options support 
  use Storable::AMF[03] qw(parse_option parse_serializator_option);
  my $options = parse_serializator_option( "raise_error, prefer_number, json_boolean" ); # or parse
  $obj = thaw( $amf, $options );
  $amf = freeze( $obj, $options );

This module is (de)serializer for Adobe's AMF0/AMF3 (Action Message Format ver 0-3). This is only module and it recognize only AMF0 data. Almost all function implemented in C for speed. And some cases faster then Storable( for me always)

  None by default.

    --- strict mode ( DoS related option)
    
        --- support for JSON::XS boolean
    
        --- try freezing double val scalars as numbers
    

  Storable::AMF0 is currently is at development stage.

At current moment and with restriction of AMF0/AMF3 format referrences to scalar are not serialized, and can't/ may not serialize tied variables.

        Due bug of Macromedia 'XML' type not serialized properly (it loose all atributes for AMF0) 
        For AMF0 has to use XMLDocument type.

Data::AMF, Storable, Storable::AMF3

Anatoliy Grishaev, <grian at cpan dot org>

        Alberto Reggiori. ( basic externalized object support )
        Adam Lounds.      ( tests and some ideas and code for boolean support )

Copyright (C) 2011 by A. G. Grishaev

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.8 or, at your option, any later version of Perl 5 you may have available.

2011-06-10 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.