My goal is to debug (step by step) the sample.plscript below.
Problem: I do not get the actual values of the variables ($ top_number, $ x, $ total).
My question is: how to see the real integer values ($ top_number, $ x, $ total) from the trace output?
What needs to be changed in perl -d:Traceto get numbers, not: $ top_number, $ x, $ total?
Example from trace output:
[root@linux /tmp]
>> ./sampl.pl:9: $top_number = 100;
>> ./sampl.pl:10: $x = 1;
>> ./sampl.pl:11: $total = 0;
>> ./sampl.pl:12: while ( $x <= $top_number ) {
>> ./sampl.pl:13: $total = $total + $x;
>> ./sampl.pl:14: $x += 1;
>> ./sampl.pl:13: $total = $total + $x;
>> ./sampl.pl:14: $x += 1;
>> ./sampl.pl:13: $total = $total + $x;
>> ./sampl.pl:14: $x += 1;
.
.
[root@linux /tmp]
$top_number = 100;
$x = 1;
$total = 0;
while ( $x <= $top_number ) {
$total = $total + $x;
$x += 1;
}
print "The total from 1 to $top_number is $total\n";
source
share