is it possible to declare a variable that can persist its value until the end of program. Actually i have a program which consist a lots of subroutine , i think u can understand my problem through this example very well
my ($i , $j); $i = 1; $j = $i - 1; my abc{}; my bca{ my $records_to_be_feched = $end - (20 * $i) - ($start - (20 * ($j))); $i = $i+1; $j = $j+1; }
firstly, variable i will go with value 1.and after that that it will increment with value 1 . but when it will go out of subroutine its value will be 1 according to global declaration. so can it be possible that first time i will be one and after that it increments by 1 and become 2...
In reply to variable declaration by Priti24
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |