http://qs1969.pair.com?node_id=448216


in reply to Array definition error

What are you trying to do?
$trainset[scalar(@trainset)] = \@inputs; $trainset[scalar(@trainset)] = \@outputs;
Is going to set the value to be \@outputs only (it will override).

So you should get 0 and 1 (the values of the outputs only) as your array elements.


Ok, nevermind, I'm thoroughly confused :)

I tested this and found the outputs to be the same except that the @trainset values are treated as strings.

$VAR1 = [ [ '0', '0' ], [ '0' ], [ '0', '1' ], [ '1' ] ]; $VAR1 = [ [ 0, 0 ], [ 0 ], [ 0, 1 ], [ 1 ] ];
--------------
"But what of all those sweet words you spoke in private?"
"Oh that's just what we call pillow talk, baby, that's all."