in reply to Code fails without any reason?

I inserted debugging code. It's failing in the OTHER place you're calling netanswer:
sub error { my ($i); for($i=0;$i<$c_NUMTRAIN;$i++) { print "netanswer called from error()\n"; &netanswer($actafer[$i]); # $ecm[$i]=ec(\@{$desout[$i]},\@z,$c_OUT); $ecm[$i]=ec($i,$c_OUT); }
There, you're just passing it $actafer[$i], which is an array reference instead of a value. The array reference then gets turned into an absurdly high index, and perl attempts to expand the array to that big, and fails. Fix error(), and the problem will go away.

Replies are listed 'Best First'.
Re: Re: Code fails without any reason?
by Bluepixel (Beadle) on May 01, 2003 at 15:16 UTC
    Thanks a lot. I must have overseen that second call :(. I thought the error was produced by the first call. I should have inserted a print command after the loop and probably would have found the error myself.