http://qs321.pair.com?node_id=144066


in reply to find the element position of $scalar

my $i=0; foreach $scalar(@array) { print("$scalar is $i element\n"); $i++; }
or, shorter:
my $i=0; for(@array) { print("$_ is $i element\n"); $i++; }


The white hole.

Replies are listed 'Best First'.
Re: Re: find the element position of $scalar
by Anonymous Monk on Feb 08, 2002 at 09:06 UTC
    Gotit! Thanks to both of you... :-) Lucie Luvsya