Dipping into Damian's "Perl Best Practices", I learn about a new module Data::Alias. I find some instances where I want to use it, revisiting some of my code - reapplying array subscripts and hash keys, especially when needed as an lvalue.

But, I come to install the module and find that it needs perl 5.8.1, and I'm trying to install it on 5.6.1. Not to be deterred, I have a peep at the source code, spotting the line

use 5.008001;
I try commenting this line out of the module and Makefile.PL, but to no avail. The module contains some very hairy XS, and refuses to compile. So, the use statement was not just boilerplate from h2xs.

Hunting around on CPAN, I find another module Lexical::Alias, which needs 5.8.0, which leads me to Devel::LexAlias (listed under see also). Devel::LexAlias only needs 5.005! Data::Alias has a much nicer API though.

Have I missed something? Is there some convenient piece of internals that enables lexical aliasing, that came in with 5.8? Is it worth building a common wrapper over either Devel::LexAlias or Data::Alias based on the perl version?

--

Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)


In reply to Lexical aliasing for perl versions prior to 5.8 by rinceWind

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.