in reply to Re: Code fails without any reason?
in thread Code fails without any reason?

for($i=0;$i<$c_IN;$i++) { print "$i $c_IN $in_i\n"; $x[$i] = $actafer[$in_i][$i]; if (not defined $x[$i]){die;} }
The $i's are counter up to 34, as they should, then $i is reset to 0 (in the same loop) which causes $x[$i] = $actafer[$in_i][$i]; to fail. Output is:
........ 28 35 9 29 35 9 30 35 9 31 35 9 32 35 9 33 35 9 34 35 9 0 35 ARRAY(0xa04116c) Out of memory during "large" request for 1073745920 bytes, total sbrk( +) is 31744 0 bytes at neuronalnetwork.pl line 137.
I was wondering why $i is reset to 0?

Replies are listed 'Best First'.
Re3: Code fails without any reason?
by dragonchild (Archbishop) on May 01, 2003 at 15:15 UTC
    Your problem may be related to $i being set to 0, but the actual issue is that $in_i is being assigned to an array reference. That is what's causing the memory issue.

    Check to see what you're doing in the error() function. :-)

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.