Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Binary data structure to moose class.

by jandrew (Hermit)
on Jan 04, 2013 at 18:22 UTC ( #1011692=note: print w/ replies, xml ) Need Help??


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


Comment on Re^3: Binary data structure to moose class.
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011692]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2014-07-26 07:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls