Hello all. Here is my code
use strict; my $z = 0; for (my $d=1; $d < 10; $d++) { $z++; if ($z==1) { print $headers, "\n"; } else { print $body, "\n"; } }
Note: $headers and $body are defined elsewhere in my code and do not necessarily pertain to my question
Question: Is there a way to reset the $z variable to zero each time the for loop iterates? I am trying to print the header each time the loop iterates.
In reply to Need to reset a variable to zero ?? by dkhalfe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |