A
alexxx.magni
Hi all, I need some advice:
in the past, when writing programs I often used, to help me in
debugging, the following style:
my $debuglevel=1;
.....
print("var value is $a\n") if ($debuglevel>0);
.....
print(LOGFILE "array values are @x\n") if ($debuglevel>2);
....
you get the idea.
Now I'm working on a project very computational-intensive, and I'm
worried about the many lines "if ($debuglevel...)" to be evaluated.
I was wandering: if $debuglevel was a constant, not a variable, it is
possible that the program, when launched, evaluates those lines from
the beginning? In this case I should not worry about later evaluation.
Any other suggestion for flow control?
thanks!
Alessandro Magni
in the past, when writing programs I often used, to help me in
debugging, the following style:
my $debuglevel=1;
.....
print("var value is $a\n") if ($debuglevel>0);
.....
print(LOGFILE "array values are @x\n") if ($debuglevel>2);
....
you get the idea.
Now I'm working on a project very computational-intensive, and I'm
worried about the many lines "if ($debuglevel...)" to be evaluated.
I was wandering: if $debuglevel was a constant, not a variable, it is
possible that the program, when launched, evaluates those lines from
the beginning? In this case I should not worry about later evaluation.
Any other suggestion for flow control?
thanks!
Alessandro Magni