There is probably no such variable, but you can play with a range operator .. in scalar context:
my @letters = qw(alfa beta gama);
for my $letter (@letters){
warn "iteration is ", scalar($0 .. !$0);
}
The $0, resp. !$0 are just expressions which are allways true, resp. allways false. Unfortunately you cannot use 1, 0 because they are given some special meaning by the range operator.
Although this "trick" works, it is not particularly self-explainable.
|