Wanted to add my $.02:
So far, I have a love it / hate it relationship with this module. I started using XML::Smart after getting sick of having to worry about what is an array and what is a scalar inside an XML originated data structure. Works well, so I went ahead and decided to put Object::MultiType to use on cgi form variables as well. I like the old cgi-lib way of getting everything into a hash, but that creates issues with multi-valued parameters. So now I have a scalar, array, and hash (keys for Boolean) of all cgi posted data as well.
So far so good.
The hate it part of this relationship is the obvious. Some modules don’t like getting fed multi-typed data so you have to export the tree. This takes you back to square one. I also like to employ the following:
no strict "refs";
&$command($data);
use strict;
And that is a no-go with multi-type data, you have to use the (‘$’) function to get the real scalar out first. Also, Data::Dumper becomes a mess; you really need to export the tree first.
All in all however, I’m sticking with my multi-typed data for now. The only module I was using that didn’t like the multi-typed data is XML::Simple and that is replaced with XML::Smart now. I’m also finding that, for me at least, the worries that Object::MultiType bring are good ones. Being that I am reminded where my data is originating as apposed to being hung up on data structure semantics. And this is the type of consistency that I rather be concerned with.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.