Hi Everyone
If I have some code where I want to call a sub routine and increase a variable within it each time I call it, how would I do that?
So for example... the below is how i tought it would work.. pseudo code style!..
run = 1 while (run == '1') { print increaseNumber(); } sub increaseNumber { my $value = 001 return $value + 1 }; ###which would print### 001 002 003 ###etc###
feel like im struggling because i'm not aware of a concept.. please help!
In reply to increasing value every time sub routine called by bigmoose
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |