develooper Front page | perl.beginners | Postings from February 2002

iteration default variable

Thread Next
From:
KAVANAGH, Michael
Date:
February 27, 2002 08:26
Subject:
iteration default variable
Message ID:
852ED745A1B8D411BBD900B0D0789E0C03D73BD2@EXC05.oup.co.uk
Hi there,

This is probably a simple one...

in a loop like this:

for (@answer) {
	#do something ...
}


I understand that for each iteration of the loop, $_ contains the value of
$answer[current iteration].
But is there a default variable I can use to get the current index value?

Can't seem to find the answer anywhere... any ideas would be helpful.

Thanks everybody for contributing to this list... I find it useful.

Thanks
Mike Kavanagh




Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About