use strict; use warnings; use feature 'say'; use Sereal qw/ encode_sereal decode_sereal /; use Storable qw/ freeze thaw /; say 'Storable: ', ${ thaw freeze \substr 'abc', 0 }; say 'Sereal: ', ${ decode_sereal encode_sereal \substr 'abc', 0 }; __END__ >perl 180524.pl Use of uninitialized value in say at 180524.pl line 8. Storable: Sereal: abc

I was passing lists of string references to mce_map for parallel processing. Because strings are substrings of larger strings, I thought to take shortcut by not creating temporary scalars, but to pass references of substr return values directly. Rather, refs are collected in large array (why whould I store duplicates?), then this array becomes parameter for mce_map. I should have known they are not references to scalars, but to lvalues, though.

Everything works fine until it doesn't, on a particular machine -- without, it turns out, Sereal installed. Storable, used by MCE in lieu of Sereal, treats these lvalue refs differently.

I didn't find anything googling for "Perl Storable lvalue", etc. Apart from my sloppy coding, I'm not even sure, if it's Storable issue, Sereal issue, or something else (maybe, MCE should check these?). Kind of, Sereal can be faster drop-in replacement for Storable. Except, it looks, not always. Any thoughts?


In reply to Subtle(?) issue(?) with lvalues and serialization by vr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.