in reply to Re^2: possible to assign symbolic references?
in thread possible to assign symbolic references?

Aliases would be less expensive once created. However, using aliases introduces more magic (especially if Data::Alias is involved) and creates more action at a distance (making the code less clear and harder to debug).

Actually, even simpler would be to use neither. The problem only exists because the addition of the scalars to the data structure is done at the top of the code.

my ($var1, $var2, ...); ... push @array, [ $var1, $var2, ... ];

The downside is that you might have to guard against exceptions and returns.

Replies are listed 'Best First'.
Re^4: possible to assign symbolic references?
by perl-diddler (Chaplain) on Sep 22, 2010 at 01:03 UTC
    I think Data::aliases is exactly what I was looking for. I didn't know it existed (guess I should have thought to look under aliases!)...

    This comment in the Data::Aliases description fits my situation perfectly:

    You can use this to improve efficiency and readability, when compared to using references.
    Thanks!
      It's currently not compatible with 5.12 (but I believe someone's (slowly) working on it).
        ARG! Using 5.10 right now, but how could they release without such an important feature...Grrr.. So much for efficiency and clarity...at least the latter never was a perl selling point... ;-)