in reply to Re^2: One Dimensional Array into Two
in thread One Dimensional Array into Two

As a general proposition, I would worry about this construct -- in particular I would worry whether @column could be changed later, generating side effects in the @sheet array.
You seem to assume that isn't what the OP wanted. Sometimes that's exactly why \@columns must be used over [ @columns ].

The OP was sufficiently vague that neither of us could have guessed at what they wanted.

Replies are listed 'Best First'.
Re^4: One Dimensional Array into Two
by JoeJaz (Monk) on Aug 22, 2008 at 17:57 UTC
    My ambiguity was probably due to the fact that I wasn't aware that there were multiple ways to do this. I guess it's Perl that we are talking about, so I should have assumed that there are always multiple ways of doing any particular thing. However, this discussion has really helped me clarify this usage. Thank you for your comments and time. Joe
Re^4: One Dimensional Array into Two
by gone2015 (Deacon) on Aug 22, 2008 at 20:02 UTC

    Well... yes. I admit it.

    From the original question I had made an obviously irrational assumption. I had assumed that the application was reading lines (presumably from a file), splitting those into columns (@column = split /\s+/, $line ;) and storing the result in a two-dimensional array of cells (@sheets). That assumption lead me astray, and I slipped into the unwise contemplation of what I now acknowledge to be a heresy.

    I freely confess my sins and repent.

    I accept, without reservation, that on occasion it may be desirable to have one (or more) rows in a two-dimensional array which are accessible by an alias, say, @columns. And I would like now to apologize, humbly and deeply, if my remarks suggested otherwise, in any way, whatsoever.

    I feel foolish now, and would like uncountably many other offences of hubris to be taken into consideration.

    In mitigation, however, I would like to draw attention to the very first words of my remarks: "As a general proposition".

    And I suggest that, in general, $sheets[1] = \@column; won't be a deliberate exercise in aliasing, but will be a potential hazard, which could bite the innocent programmer in their unsuspecting gluteus maximus (or glutinous maximus, in some cases).

    I now undertake to collect my hair shirt from the cleaners at the earliest opportunity, and wear it more often to remind me to transgress no more.