the way to get current index of an array
- From: zhao_bingfeng@xxxxxxxxxxxxx (Zhao Bingfeng)
- Date: Tue, 28 Feb 2006 13:07:03 +0800
hi, perlers,
Is there a simple way to get the current index of an array in loop statement?
the procondition is you cannot get this information from array element. For
example
#!usr/bin/perl
my @arr = qw/a b c d e/;
for(@arr)
{
print "The No.?? element is $_\n";
}
-----------------------------------------------
Life is a different teacher...
It doesn't teach lessons, and then keep exams...
It keeps the exams first and then teaches the lessons.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
- Follow-Ups:
- Re: the way to get current index of an array
- From: The Ghost
- Re: the way to get current index of an array
- From: Bob Showalter
- Re: the way to get current index of an array
- From: JupiterHost.Net
- Re: the way to get current index of an array
- From: John W. Krahn
- Re: the way to get current index of an array
- Prev by Date: Re: num to alpha
- Next by Date: Re: the way to get current index of an array
- Previous by thread: mailing labels
- Next by thread: Re: the way to get current index of an array
- Index(es):