Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^5: undefined value in array reference

by kennethk (Abbot)
on Mar 31, 2011 at 21:56 UTC ( #896736=note: print w/replies, xml ) Need Help??

in reply to Re^4: undefined value in array reference
in thread undefined value in array reference

So you are trying essentially to strip out the $y - 1 column, assuming your AoA is $aob[row][column]? In that case, your code might look like:

my @row = map $_->[$y - 1], @aob;

If not, I'm really lost as to the spec.

Replies are listed 'Best First'.
Re^6: undefined value in array reference
by Dandello (Monk) on Mar 31, 2011 at 22:22 UTC

    YES! - well, it's actually mapping out as $aob[column][row] But that's a minor issue that's all though the whole project. Maybe my conventions are a little off from everyone else's. Wouldn't be the first time.

    Be that as it may my @row = map $_->[$y - 1], @aob; gives me proper results in the output without resorting to a foreach loop.

    Thank You

      For a little background on the column/row confusion, see Row-major_order.

      Glad to have helped.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://896736]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2019-08-17 10:29 GMT
Find Nodes?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?

    Results (134 votes). Check out past polls.