in reply to grep { } positional number of element
grep is wrong thing to use here, you could use each:
my @array = ( "Alfa","beta","gamma"); while (my ($index, $element) = each(@array)) { print "$index => $element\n"; }
Output:
0 => Alfa 1 => beta 2 => gamma
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: grep { } positional number of element
by ibm1620 (Hermit) on Oct 23, 2022 at 22:27 UTC | |
|
Re^2: grep { } positional number of element
by Your Mother (Archbishop) on Oct 23, 2022 at 23:45 UTC | |
|
Re^2: grep { } positional number of element
by Bod (Parson) on Oct 23, 2022 at 22:29 UTC | |
by bliako (Abbot) on Oct 24, 2022 at 13:22 UTC | |
by Bod (Parson) on Oct 25, 2022 at 16:35 UTC | |
by LanX (Saint) on Oct 25, 2022 at 16:53 UTC | |
|
Re^2: grep { } positional number of element
by bliako (Abbot) on Oct 24, 2022 at 13:31 UTC |