http://www.perlmonks.org?node_id=1011692


in reply to Re^2: Binary data structure to moose class.
in thread Binary data structure to moose class.

chrestomanci I personally found that a combination of the Moose::Cookbook followed with a good dose of the Moose::Manual was the most concise way to kick-start my Moose learning. However the Moose presentation from Ricardo Signes is a good read. I'm at $work so I can't check that last link.

The goal of the writers is not to write binary data in the attributes but to write the unpacked data to each attribute from the object so you can use it as follows. (Note the writers are mostly hidden using the _ prefix convention) Assume the Class is called Data::Humanx and that the MooseX::Types coersion worked. Example not tested

use Data::Humanx my $instance = Data::Humanx-new( rawDataBlock => $content ); print $instance->startTime->ymd( '/' );

This should print out the start time value in ymd format from the Humanx binary that was input. (This assumes a DateTime object in the startTime attribute)

Update: The link is good