Quite amount of interest exists in use of Perl for
interprocess message passing and
object-oriented persistence, in fact there is a list called poop-scoop (perl 0bject-oriented persistence) devoted to this this topic.
Cons is a tool for constructing software systems --- a Perl-based make replacement.
However, as I was reading through its docs, I noticed that it automatically would export scalars from a Cons program (nothing but a perl script that uses the Cons API) in one directory to a Cons program in another... poof! This means it does message passing for you without learning POE or Class::Tom or some other beast.
So now I unveil my tour de force, my arc de triomphe, my yo-check-it-out-daddy-its-megafresh, example of having Cons automatically serialize my data (ala, Data::Dumper or Freezethaw or Storable) and de-serialize it in another process:
# This is a Cons "Construct" file. It exports a scalar
# named po, which is received by the perl program
# tmp/Conscript
$po = { 1, 'two', 'buckle my', 'shoo' };
Export qw (po);
Build qw (tmp/Conscript);
# This is the tmp/Conscript. I receive serialized data and
# process it, in this case, simply printing it to STDERR
Import qw( po ) ;
use Data::Dumper;
warn Data::Dumper->Dump([$po],['po']);
Output of run is
$po = {
1 => 'two',
'buckle my' => 'shoo'
};
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.