in reply to Spurious `undefined' values and conversion issues

On line 1158:

my $split1 = (($energy_before[$j]-$energy_rebin[$k])*$totcount)/($ener +gy_before[$j]-$energy_before[${j}-1]);

Note the "$energy_before[${j}-1]". What happens to that index when $j is 0?


-- 
Human history becomes more and more a race between education and catastrophe. -- HG Wells

Replies are listed 'Best First'.
Re^2: Spurious `undefined' values and conversion issues
by sf_ashley (Sexton) on May 30, 2008 at 18:25 UTC

    Thanks for your suggestion, oko1. If $j=0, the if loop shouldn't run, as the logic condition given in the if statement is if(($energy_rebin[$k] < $energy_before[$j]) && $j!=0){. The problem for this case was that $j was too large due to a typograhical error in the 'for' loop and this yielded the undefined value problem.

    However, many thanks for looking through the code and for your suggestion.

    Steve